Platform SDK: Hardware

PBT_APMPOWERSTATUSCHANGE

The PBT_APMPOWERSTATUSCHANGE event is broadcast when a change in the power status of the computer is detected, such as a switch from battery power to A/C. The system also broadcasts this event when remaining battery power slips below the threshold specified by the user or if the battery power changes by a specified percentage.

A window receives this event through the WM_POWERBROADCAST message. The wParam and lParam parameters are set as described following.

Parameters

wParam
Set to PBT_APMPOWERSTATUSCHANGE.
lParam
Reserved; must be 0.

Return Values

No return value.

Remarks

An application should process this event by calling the GetSystemPowerStatus function to retrieve the current power status of the computer. In particular, the application should check the ACLineStatus, BatteryFlag, BatteryLifeTime, and BatteryLifePercent members of the SYSTEM_POWER_STATUS structure for any changes. This event can occur when battery life drops to less than 5 minutes, or when the percentage of battery life drops below 10 percent, or if the battery life changes by 3 percent.

Requirements

  Windows NT/2000: Requires Windows 2000.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Pbt.h.

See Also

Power Management Overview, Power Management Events, GetSystemPowerStatus, SYSTEM_POWER_STATUS, WM_POWERBROADCAST