PBT_APMPOWERSTATUSCHANGE

[This is preliminary documentation and subject to change.]

The PBT_APMPOWERSTATUSCHANGE message is sent when a change in the power status of the computer is detected, such as a switch from battery power to A/C or a drop in remaining battery power below a threshold. A window receives this message through the WM_POWERBROADCAST message.

dwData = (DWORD) lParam; 
 

Parameters

dwData
Reserved; must be 0.

Return Values

No return value.

Remarks

An application should process this message 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 message can occur when battery life drops to less than 5 minutes, or when the percentage of battery life drops below 10 percent.

QuickInfo

  Windows NT: Requires version 5.0 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in pbt.h.

See Also

Power Management Overview, Power Management Messages, GetSystemPowerStatus, SYSTEM_POWER_STATUS, WM_POWERBROADCAST