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(
  HANDLE hMsgQ,
  DWORD Flags
);

Parameters

hMsgQ
[in] Handle to the application's message queue created with CreateMsgQueue.
Flags
[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.

NotificationDescription
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.

Remarks

Power notification events are issued in a POWER_BROADCAST structure through message queues.

Requirements

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.


Show: