RequestPowerNotifications

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

  • ERROR_SUCCESS
    Request registered successfully.
  • ERROR_INVALID_PARAMETER
    Invalid message queue or flag value.

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

 Last updated on Tuesday, May 18, 2004

© 1992-2003 Microsoft Corporation. All rights reserved.