Power Management Notification Interface (Compact 2013)
3/26/2014
Power Manager provides a set of functions that allows applications to receive notifications of power-related events. These functions are shown in the following table.
Notification Functions
Function |
Description |
---|---|
Requests that Power Manager send notifications of system power events. |
|
Cancels a notification request made by RequestPowerNotifications. |
Power Manager delivers notifications through message queues. To receive notifications, an application must create a message queue and pass the message queue handle to Power Manager by calling the RequestPowerNotifications function. Applications typically create a thread that waits for notifications from the message queue. Power Manager supports the notifications shown in the following table. An application developer can specify one or more of these notification flags to indicate which notifications his application is to receive.
Notification Types
Notification |
Description |
---|---|
PBT_RESUME |
Generates notifications when the system resumes from a suspended state. |
PBT_POWERSTATUSCHANGE |
Generates notifications when the system transitions to or from AC power. |
PBT_TRANSITION |
Generates notifications when Power Manager is performing a system power state change. |
PBT_POWERINFOCHANGE |
Generates notifications when battery information or AC line status changes. |
PBT_SUSPENDKEYPRESSED |
Generates notifications when the user has pressed the suspend key. |
Applications can specify the bit mask POWER_NOTIFY_ALL to indicate that the application needs to receive every type of power notification.