Export (0) Print
Expand All

RequestPowerNotifications (Windows CE 5.0)

Windows CE 5.0
Send Feedback

This function allows applications and drivers to register for power notification events.

HANDLE RequestPowerNotifications(
  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.

PBT_TRANSITIONBroadcast specifying the system power state transition.
PBT_RESUMEBroadcast notifying a resume and specifies the previous state.
PBT_POWERSTATUSCHANGEBroadcast specifying that the power supply has switched either from AC to DC or from DC to AC.
PBT_POWERINFOCHANGEBroadcast specifying that a battery power status field has changed. This notification has an associated POWER_BROADCAST_POWER_INFO structure.

Return Values

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.
Header: Pm.h.
Link Library: Coredll.lib.

See Also

CreateMsgQueue | POWER_BROADCAST | StopPowerNotifications

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.

© 2015 Microsoft