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.
Notifies applications of a change in the power status of the computer, 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.
LRESULT
CALLBACK
WindowProc( HWND hwnd, // handle to window
UINT uMsg, // WM_POWERBROADCAST
WPARAM wParam, // PBT_APMPOWERSTATUSCHANGE
LPARAM lParam); // zero
hwnd
A handle to window.
uMsg
Value | Meaning |
---|---|
|
Message identifier. |
wParam
Value | Meaning |
---|---|
|
Event identifier. |
lParam
Reserved; must be zero.
No return value.
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.
Requirement | Value |
---|---|
Minimum supported client |
Windows XP [desktop apps only] |
Minimum supported server |
Windows Server 2003 [desktop apps only] |
Header |
|
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