Function Reference


_WinAPI_RegisterPowerSettingNotification

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

#include <WinAPISys.au3>
_WinAPI_RegisterPowerSettingNotification ( $hWnd, $sGUID )

Parameters

$hWnd Handle to the window that receives the change or notification messages.
$sGUID The 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

Return Value

Success: A notification handle for unregistering for power notifications.
Failure: 0, call _WinAPI_GetLastError() to get extended error information.

Remarks

After calling this function, notifications are sent to the specified window using WM_POWERBROADCAST
messages with a wParam parameter of PBT_POWERSETTINGCHANGE.
    (see MSDN for more information)

This function requires Windows Vista or later.

See Also

Search RegisterPowerSettingNotification in MSDN Library.