函数参考


_WinAPI_RegisterPowerSettingNotification

Registers the application to receive power setting notifications for the specific power setting event.

#Include <WinAPIEx.au3>
_WinAPI_RegisterPowerSettingNotification ( $hWnd, $GUID )

参数

$hWnd Handle to the window that receives the change or notification messages.
$GUID The a string that represents a GUID of the power setting for which notifications are to be sent.
It may be one of the following values.

$GUID_ACDC_POWER_SOURCE
$GUID_BATTERY_PERCENTAGE_REMAINING
$GUID_IDLE_BACKGROUND_TASK
$GUID_MONITOR_POWER_ON
$GUID_POWERSCHEME_PERSONALITY
$GUID_SYSTEM_AWAYMODE

返回值

Success A notification handle for unregistering for power notifications.
失败: 返回 0 并设置 @error 标志为非 0 值.

注意/说明

After calling this function, notifications are sent to the specified window using WM_POWERBROADCAST
messages with a wParam parameter of PBT_POWERSETTINGCHANGE (查看MSDN得到更多信息).

本函数需要 Windows Vista 或更高版本系统.

相关

详情参考

在MSDN中搜索