다음을 통해 공유


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

    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.

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.