POWER_BROADCAST (Compact 2013)

3/26/2014

This structure is used to issue power notification events through message queues.

Syntax

struct {
  DWORD Message;
  DWORD Flags;
  DWORD Length;
  WCHAR SystemPowerState[1];
} POWER_BROADCAST, *PPOWER_BROADCAST;

Members

  • Message
    This field defines the event type. Set to one of the events shown in the following table.

    Event type

    Description

    PBT_POWERINFOCHANGE

    A member of the POWER_BROADCAST_POWER_INFO structure has changed.

    You should not call GetBatteryStatusEx directly. Instead, register with Power Manager for a PBT_POWERINFOCHANGE that contains the same amount of information. The battery driver polls as necessary to extract data from the driver, and then pushes changes to Power Manager with PowerPolicyNotify.

    PBT_POWERSTATUSCHANGE

    Power supply switched to/from AC/DC.

    PBT_RESUME

    Resume from previous state.

    PBT_TRANSITION

    System power state transition.

  • Flags
    Use one of the system power flags shown in the following table.

    System power flag

    Description

    POWER_STATE_BACKLIGHTON

    Screen backlight is on.

    POWER_STATE_BOOT

    Boot state.

    POWER_STATE_CRITICAL

    Critical off.

    POWER_STATE_IDLE

    Idle state.

    POWER_STATE_ON

    On state.

    POWER_STATE_OFF

    No power, full off.

    POWER_STATE_RESET

    Reset state.

    POWER_STATE_SUSPEND

    Suspended state.

    POWER_STATE_UNATTENDED

    Unattended state.

    POWER_STATE_USERIDLE

    User idle state.

  • Length
    The byte count of SystemPowerState.
  • SystemPowerState
    The named system power state Flags.

Remarks

Applications and drivers register for power events with RequestPowerNotifications and unregister with StopPowerNotifications. Power notification events are issued in a POWER_BROADCAST structure, through message queues.

These notifications are multicast messages that are sent only to applications and drivers that have registered to receive the messages.

The POWER_BROADCAST structure has a variable length. The SystemPowerState array is a placeholder for data associated with the message being broadcast and is not always WCHAR data. For example, the PBT_POWERINFOCHANGE message embeds a POWER_BROADCAST_POWER_INFO structure.

Requirements

Header

pm.h

See Also

Reference

Power Management Structures
RequestPowerNotifications
StopPowerNotifications