PowerSettingRegisterNotification function (powersetting.h)
Registers to receive notification when a power setting changes.
DWORD PowerSettingRegisterNotification( [in] LPCGUID SettingGuid, [in] DWORD Flags, [in] HANDLE Recipient, [out] PHPOWERNOTIFY RegistrationHandle );
A GUID that represents the power setting.
Information about the recipient of the notification. This parameter can be one of the following values:
||The Recipient parameter is a handle to a service.Use the CreateService or OpenService function to obtain this handle.|
||The Recipient parameter is a pointer to a callback function to call when the power setting changes.|
A handle to the recipient of the notifications.
A handle to the registration. Use this handle to unregister for notifications.
Returns ERROR_SUCCESS (zero) if the call was successful, and a nonzero value if the call failed.
Immediately after registration, the callback will be invoked with the current value of the power setting. If the registration occurs while the power setting is changing, you may receive multiple callbacks; the last callback is the most recent update.
|Minimum supported client||Windows 7 [desktop apps only]|
|Minimum supported server||Windows Server 2008 R2 [desktop apps only]|