POWER_ACTION_POLICY structure (winnt.h)

Contains information used to set the system power state.

Syntax

typedef struct {
  POWER_ACTION Action;
  DWORD        Flags;
  DWORD        EventCode;
} POWER_ACTION_POLICY, *PPOWER_ACTION_POLICY;

Members

Action

The requested system power state. This member must be one of the POWER_ACTION enumeration type values.

Flags

A flag that controls how to switch the power state. This member can be one or more of the following values.

Value Meaning
POWER_ACTION_CRITICAL
0x80000000
Forces a critical suspension.
POWER_ACTION_DISABLE_WAKES
0x40000000
Disables all wake events.
POWER_ACTION_LIGHTEST_FIRST
0x10000000
Uses the first lightest available sleep state.
POWER_ACTION_LOCK_CONSOLE
0x20000000
Requires entry of the system password upon resume from one of the system standby states.
POWER_ACTION_OVERRIDE_APPS
0x00000004
Has no effect.
POWER_ACTION_QUERY_ALLOWED
0x00000001
Has no effect.
POWER_ACTION_UI_ALLOWED
0x00000002
Applications can prompt the user for directions on how to prepare for suspension. Sets bit 0 in the Flags parameter passed in the lParam parameter of WM_POWERBROADCAST.

EventCode

The level of user notification. This member can be one or more of the following values.

Value Meaning
POWER_FORCE_TRIGGER_RESET
0x80000000
Clears a user power button press.
POWER_LEVEL_USER_NOTIFY_EXEC
0x00000004
Specifies a program to be executed.
POWER_LEVEL_USER_NOTIFY_SOUND
0x00000002
User notified using sound.
POWER_LEVEL_USER_NOTIFY_TEXT
0x00000001
User notified using the UI.
POWER_USER_NOTIFY_BUTTON
0x00000008
Indicates that the power action is in response to a user power button press.
POWER_USER_NOTIFY_SHUTDOWN
0x00000010
Indicates a power action of shutdown/off.

Requirements

Requirement Value
Minimum supported client Windows XP [desktop apps only]
Minimum supported server Windows Server 2003 [desktop apps only]
Header winnt.h (include Windows.h)

See also

GLOBAL_USER_POWER_POLICY

MACHINE_POWER_POLICY

USER_POWER_POLICY

WM_POWERBROADCAST