Power management
get_device_power_state DEVICEHANDLE |
get_power_status |
SetThreadExecutionState EXECUTIONSTATE |
start_power_monitor SCRIPT |
stop_power_monitor POWER_ID |
suspend_system ?options? |
This module provides commands related to power management in a Windows system.
The command suspend_system may be used to put the system in stand by or hibernate states. You can prevent the system from being suspended due to inactivity through the SetThreadExecutionState command.
The current state of the power subsystem, including battery status, can be obtained through the get_power_status command. The state of an individual device can be obtained through the get_device_power_state command.
Changes in the power subsystem state can be monitored through the start_power_monitor and stop_power_monitor.
-acstatus | Indicates the state of the AC power. May have the values on, off or unknown. |
-batterystate | Indicates the state of the battery charge. May be critical, low, high or unknown. |
-batterycharging | Indicates whether the battery is being charged. May have the values true, false or unknown. |
-batterylifepercent | Indicates the percentage of the full battery life remaining or has the value unknown. |
-batterylifetime | Indicates the remaining battery life time in seconds, if known, or has the value unknown. |
-batteryfulllifetime | Indicates the number of seconds of battery life when it is full, or has the value unknown. |
apmbatterylow | Indicates that the system battery is low. |
apmoemevent | Indicates an OEM-defined event. |
apmpowerstatuschange | Indicates a change in the power status. Details may be obtained by calling get_power_status. |
apmquerysuspendfailed | Indicates that a query to suspend the computer was denied. |
apmresumeautomatic | Indicates that the system has woken up to handle an event. |
apmresumecritical | Indicates the system has woken up after a critical system suspension (e.g. due to very low battery) where it was not possible to notify all applications before the suspension. |
apmresumesuspend | Indicates that the system has resumed normal operation after a suspension. |
apmsuspend | Indicates the system is about to be suspended and applications should save state and data if necessary. |
-state STATE | STATE must be one of standby (default) or hibernate depending on whether the state into which the system is to be placed. |
-force BOOLEAN | If false (default), the system sends a PBT_ATMQUERYSUSPEND message to all applications before placing the system in stand by or hibernate states. If this option is specified as true, the message is not sent and the system is immediately placed into the appropriate state. |
-disablewakeevents BOOLEAN | If false (default), system wake events remain enabled. If true they are disabled. |
Copyright © 2008 Ashok P. Nadkarni