Retrieves information about the system power capabilities.
#Include <WinAPIEx.au3>
_WinAPI_GetPwrCapabilities ( )
None. |
Success | The array that contains the following information: |
] | If TRUE, there is a system power button. |
] | If TRUE, there is a system sleep button. |
] | If TRUE, there is a lid switch. |
] | If TRUE, the operating system supports sleep state S1. |
] | If TRUE, the operating system supports sleep state S2. |
] | If TRUE, the operating system supports sleep state S3. |
] | If TRUE, the operating system supports sleep state S4 (hibernation). |
] | If TRUE, the operating system supports power off state S5 (soft off). |
] | If TRUE, the system hibernation file is present. |
] | If TRUE, the system supports wake capabilities. |
[10] | If TRUE, the system supports video display dimming capabilities. |
[11] | If TRUE, the system supports APM BIOS power management features. |
[12] | If TRUE, there is an uninterruptible power supply (UPS). |
[13] | If TRUE, the system supports thermal zones. |
[14] | If TRUE, the system supports processor throttling. |
[15] | The minimum level of system processor throttling supported, expressed as a percentage. |
[16] | The maximum level of system processor throttling supported, expressed as a percentage. |
[17] | If TRUE, the system supports the hybrid sleep state. |
[18] | If TRUE, the system supports allowing the removal of power to fixed disk devices. |
[19] | If TRUE, there are one or more batteries in the system. |
[20] | If TRUE, the system batteries are short-term. Short-term batteries are used in uninterruptible power supplies (UPS). |
[21] | The lowest system sleep state (Sx) that will generate a wake event when the system is on AC power. |
[22] | The lowest system sleep state (Sx) that will generate a wake event via the lid switch. |
[23] | The lowest system sleep state (Sx) supported by hardware that will generate a wake event via the RTC. |
[24] | The minimum allowable system power state supporting wake events. |
失败: | 返回 0 并设置 @error 标志为非 0 值. |
在MSDN中搜索
#Include <Array.au3>
#Include <WinAPIEx.au3>
Opt('MustDeclareVars', 1)
Global $Data = _WinAPI_GetPwrCapabilities()
Global $Info[25][2] = _
[['Power button', 0], _
['Sleep button', 0], _
['Lid switch', 0], _
['S1', 0], _
['S2', 0], _
['S3', 0], _
['S4', 0], _
['S5', 0], _
['HIBERFIL.SYS', 0], _
['Wake', 0], _
['Video display dimming', 0], _
['APM BIOS', 0], _
['UPS', 0], _
['Thermal zones', 0], _
['Throttling', 0], _
['Throttling min level', 0], _
['Throttling max level', 0], _
['Hibernation', 0], _
['HDD power down', 0], _
['Batteries', 0], _
['Batteries short-term', 0], _
['AC lowest wake state', 0], _
['Lid lowest wake state', 0], _
['RTC lowest wake state', 0], _
['Minimum device wake state', 0]]
If IsArray($Data) Then
For $i = 0 To UBound($Info) - 1
$Info[$i][1] = $Data[$i]
Next
Else
Exit
EndIf
_ArrayDisplay($Info, '_WinAPI_GetPwrCapabilities')