WM_APCSYSMSG_POWERSTATECHANGE

This message is sent when the power is turned off or on.

Parameters

wParam
Specifies the power notification type. It is one of the following values:
Power notification type
Value
APC_PWRNOTIFYTYPE_USER 1
APC_PWRNOTIFYTYPE_ELECTRICAL 2
APC_PWRNOTIFYTYPE_BACKUPBATTERY_LOW 3

lParam
For USER and ELECTRICAL, set to TRUE if the power state is changed to ON, or to FALSE if the power state is changed to OFF.

For BATTERY_LOW, HIWORD(lParam) is FALSE if the battery is low, or TRUE if the battery is not low. LOWORD(lParam) gives the zero-based index of the battery.

Remarks

An APC_PWRNOTIFYTYPE_ELECTRICAL notification is not sent when the electrical power is removed, only when it is restored.