WM_POWER

The WM_POWER message is sent when the system, typically a battery-powered personal computer, is about to enter the suspended mode.

Parameters

wParam

Specifies a power-event notification code. This parameter may be one of the following values:

Value Meaning

PWR_SUSPENDREQUEST Indicates that the system is about to enter the suspended mode.
PWR_SUSPENDRESUME Indicates that the system is resuming operation after having entered the suspended mode normally. That is, the system sent a PWR_SUSPENDREQUEST notification code to the application before the system was suspended. An application should perform any necessary recovery actions.
PWR_CRITICALRESUME Indicates that the system is resuming operation after having entered the suspended mode without first sending a PWR_SUSPENDREQUEST notification code to the application. An application should perform any necessary recovery actions.

lParam

This parameter is not used.

Return Value

If the wParam parameter specifies the PWR_SUSPENDREQUEST notification code, an application should return PWR_FAIL to prevent the system from entering the suspended state; otherwise, an application should return PWR_OK. If the wParam parameter specifies the PWR_SUSPENDRESUME or PWR_CRITICALRESUME, an application should return zero.

Comments

This message is only sent to an application that is running on a system that conforms to the advanced power management (APM) BIOS specification. The message is sent by the power-management driver to each window returned by the EnumWindows function.

Suspend mode is the state in which the greatest amount of power savings occurs, but all operational data and parameters is preserved. RAM contents are preserved, but many devices are likely to be turned off.

See Also

EnumWindows