Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Contains information about the power status of the system.
typedef struct _SYSTEM_POWER_STATUS {
BYTE ACLineStatus;
BYTE BatteryFlag;
BYTE BatteryLifePercent;
BYTE SystemStatusFlag;
DWORD BatteryLifeTime;
DWORD BatteryFullLifeTime;
} SYSTEM_POWER_STATUS, *LPSYSTEM_POWER_STATUS;
ACLineStatus
The AC power status. This member can be one of the following values.
Value | Meaning |
---|---|
|
Offline |
|
Online |
|
Unknown status |
BatteryFlag
The battery charge status. This member can contain one or more of the following flags.
Value | Meaning |
---|---|
|
High—the battery capacity is at more than 66 percent |
|
Low—the battery capacity is at less than 33 percent |
|
Critical—the battery capacity is at less than five percent |
|
Charging |
|
No system battery |
|
Unknown status—unable to read the battery flag information |
The value is zero if the battery is not being charged and the battery capacity is between low and high.
BatteryLifePercent
The percentage of full battery charge remaining. This member can be a value in the range 0 to 100, or 255 if status is unknown.
SystemStatusFlag
The status of battery saver. To participate in energy conservation, avoid resource intensive tasks when battery saver is on. To be notified when this value changes, call the RegisterPowerSettingNotification function with the power setting GUID, GUID_POWER_SAVING_STATUS.
Value | Meaning |
---|---|
|
Battery saver is off. |
|
Battery saver on. Save energy where possible. |
BatteryLifeTime
The number of seconds of battery life remaining, or –1 if remaining seconds are unknown or if the device is connected to AC power.
BatteryFullLifeTime
The number of seconds of battery life when at full charge, or –1 if full battery lifetime is unknown or if the device is connected to AC power.
The system is only capable of estimating BatteryFullLifeTime based on calculations on BatteryLifeTime and BatteryLifePercent. Without smart battery subsystems, this value may not be accurate enough to be useful.
Requirement | Value |
---|---|
Minimum supported client | Windows XP [desktop apps only] |
Minimum supported server | Windows Server 2003 [desktop apps only] |
Header | winbase.h (include Windows.h) |
Events
May 19, 6 PM - May 23, 12 AM
Calling all developers, creators, and AI innovators to join us in Seattle @Microsoft Build May 19-22.
Register today