Export (0) Print
Expand All

SYSTEM_POWER_STATUS structure

Contains information about the power status of the system.

Syntax


typedef struct _SYSTEM_POWER_STATUS {
  BYTE  ACLineStatus;
  BYTE  BatteryFlag;
  BYTE  BatteryLifePercent;
  BYTE  SystemStatusFlag;
  DWORD BatteryLifeTime;
  DWORD BatteryFullLifeTime;
} SYSTEM_POWER_STATUS, *LPSYSTEM_POWER_STATUS;

Members

ACLineStatus

The AC power status. This member can be one of the following values.

ValueMeaning
0

Offline

1

Online

255

Unknown status

 

BatteryFlag

The battery charge status. This member can contain one or more of the following flags.

ValueMeaning
1

High—the battery capacity is at more than 66 percent

2

Low—the battery capacity is at less than 33 percent

4

Critical—the battery capacity is at less than five percent

8

Charging

128

No system battery

255

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, save power when battery saver is engaged. To be notified when this value changes, call the RegisterPowerSettingNotification function with the power setting GUID, GUID_POWER_SAVING_STATUS.

ValueMeaning
0

Battery saver is not engaged.

1

Battery saver is engaged. Conserve energy where possible.

 

Note  This flag and the GUID_POWER_SAVING_STATUS GUID were introduced in Windows 10 Technical Preview. This flag was previously reserved, named Reserved1, and had a value of 0.
BatteryLifeTime

The number of seconds of battery life remaining, or –1 if remaining seconds are unknown.

BatteryFullLifeTime

The number of seconds of battery life when at full charge, or –1 if full battery lifetime is unknown.

Remarks

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.

Requirements

Minimum supported client

Windows XP [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Winbase.h (include Windows.h)

See also

GetSystemPowerStatus
PBT_APMPOWERSTATUSCHANGE

 

 

Community Additions

ADD
Show:
© 2015 Microsoft