Export (0) Print
Expand All
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

RequestPowerNotifications

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

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


HANDLE RequestPowerNotifications(
  HANDLE hMsgQ,
  DWORD Flags
);

hMsgQ

[in] Handle to the application message queue created with CreateMsgQueue. CreateMsgQueue requires a pointer to a MSGQUEUEOPTIONS structure. Set the cbMaxMessage parameter of the MSGQUEUEOTPIONS structure to sizeof(POWER_BROADCAST) + (MAX_PATH * sizeof TCHAR).

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

Notification Description

PBT_POWERINFOCHANGE

Broadcast specifying that a battery power status field has changed. This notification has an associated POWER_BROADCAST_POWER_INFO structure.

PBT_POWERSTATUSCHANGE

Broadcast specifying that the power supply has switched either from AC to DC or from DC to AC.

PBT_RESUME

Broadcast notifying that the system is resuming and specifies the previous state.

PBT_TRANSITION

Broadcast specifying the system power state transition.

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.

Community Additions

Show:
© 2015 Microsoft