RequestPowerNotifications (Windows CE 5.0)
This function allows applications and drivers to register for power notification events.
HANDLE RequestPowerNotifications(HANDLE hMsgQ,DWORD Flags);
[in] Handle to the application's message queue created with CreateMsgQueue.
[in] Set to the logical-or of the desired PBT_XXX notifications, or to POWER_NOTIFY_ALL to receive all notifications.
The following table shows the various PBT_XXX notifications.
Notification Description PBT_TRANSITION Broadcast specifying the system power state transition. PBT_RESUME Broadcast notifying a resume and specifies the previous state. PBT_POWERSTATUSCHANGE Broadcast specifying that the power supply has switched either from AC to DC or from DC to AC. PBT_POWERINFOCHANGE Broadcast specifying that a battery power status field has changed. This notification has an associated POWER_BROADCAST_POWER_INFO structure.
Nonzero indicates success. Zero indicates failure. To get extended error information, call GetLastError.
Power notification events are issued in a POWER_BROADCAST structure through message queues.
OS Versions: Windows CE .NET 4.0 and later.
Link Library: Coredll.lib.
Send Feedback on this topic to the authors