Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

POWER_ACTION_POLICY (Structures)
 
.
Summary
TODO - a short description

C# Definition:

enum POWER_ACTION : uint
{
   PowerActionNone = 0,       // No system power action.
   PowerActionReserved,       // Reserved; do not use.
   PowerActionSleep,      // Sleep.
   PowerActionHibernate,      // Hibernate.
   PowerActionShutdown,       // Shutdown.
   PowerActionShutdownReset,  // Shutdown and reset.
   PowerActionShutdownOff,    // Shutdown and power off.
   PowerActionWarmEject,      // Warm eject.
struct POWER_ACTION_POLICY {
   POWER_ACTION Action;
   uint Flags;
   uint EventCode;
}

[Flags]
enum PowerActionFlags : uint
{
   POWER_ACTION_QUERY_ALLOWED  = 0x00000001, // Broadcasts a PBT_APMQUERYSUSPEND event to each application to request permission to suspend operation.
   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.
   POWER_ACTION_OVERRIDE_APPS  = 0x00000004, // Ignores applications that do not respond to the PBT_APMQUERYSUSPEND event broadcast in the WM_POWERBROADCAST message.
   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_DISABLE_WAKES  = 0x40000000, // Disables all wake events.
   POWER_ACTION_CRITICAL       = 0x80000000, // Forces a critical suspension.
}

[Flags]
enum PowerActionEventCode : uint
{
   POWER_LEVEL_USER_NOTIFY_TEXT  = 0x00000001, // User notified using the UI.
   POWER_LEVEL_USER_NOTIFY_SOUND = 0x00000002, // User notified using sound.
   POWER_LEVEL_USER_NOTIFY_EXEC  = 0x00000004, // Specifies a program to be executed.
   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.
   POWER_FORCE_TRIGGER_RESET     = 0x80000000, // Clears a user power button press.
}

[StructLayout(LayoutKind.Sequential, Pack=1)]
struct POWER_ACTION_POLICY
{
   public POWER_ACTION Action;
   public PowerActionFlags Flags;
   public PowerActionEventCode EventCode;
}

VB Definition:

Enum POWER_ACTION
   PowerActionNone = 0    ' No system power action.
   PowerActionReserved    ' Reserved; do not use.
   PowerActionSleep       ' Sleep.
   PowerActionHibernate       ' Hibernate.
   PowerActionShutdown    ' Shutdown.
   PowerActionShutdownReset   ' Shutdown and reset.
   PowerActionShutdownOff     ' Shutdown and power off.
   PowerActionWarmEject       ' Warm eject.
End Enum

<Flags>
Enum PowerActionFlags
   POWER_ACTION_QUERY_ALLOWED = 0x00000001   ' Broadcasts a PBT_APMQUERYSUSPEND event to each application to request permission to suspend operation.
   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.
   POWER_ACTION_OVERRIDE_APPS = 0x00000004   ' Ignores applications that do not respond to the PBT_APMQUERYSUSPEND event broadcast in the WM_POWERBROADCAST message.
   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_DISABLE_WAKES = 0x40000000   ' Disables all wake events.
   POWER_ACTION_CRITICAL = &H80000000    ' Forces a critical suspension.
End Enum

<Flags>
Enum PowerActionEventCode
   POWER_LEVEL_USER_NOTIFY_TEXT = &H1     ' User notified using the UI.
   POWER_LEVEL_USER_NOTIFY_SOUND = &H2    ' User notified using sound.
   POWER_LEVEL_USER_NOTIFY_EXEC = &H4     ' Specifies a program to be executed.
   POWER_USER_NOTIFY_BUTTON = &H8     ' Indicates that the power action is in response to a user power button press.
   POWER_USER_NOTIFY_SHUTDOWN = &H10      ' Indicates a power action of shutdown/off.
   POWER_FORCE_TRIGGER_RESET = &H80000000 ' Clears a user power button press.
End Enum

<StructLayout(LayoutKind.Sequential, Pack:=1)>
Structure POWER_ACTION_POLICY
   Public Action As POWER_ACTION
   Public Flags As PowerActionFlags
   Public EventCode As PowerActionEventCode
   Public TODO
End Structure

User-Defined Field Types:

POWER_ACTION

Notes:

None.

Documentation

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions