Platform SDK: Hardware |
The PBT_APMQUERYSUSPEND event is broadcast to request permission to suspend the computer. An application that grants permission should carry out preparations for the suspension before returning.
A window receives this event through the WM_POWERBROADCAST message. The wParam and lParam parameters are set as described following.
Return TRUE to grant the request to suspend. To deny the request, return BROADCAST_QUERY_DENY.
An application should process this event by first determining whether permission to suspend can be granted. It must not grant permission if doing so would cause a loss of data. The application can prompt the user for directions on how to prepare for suspension only if bit 0 in the Flags parameter is set.
The system allows approximately 20 seconds for an application to remove the WM_POWERBROADCAST message that is sending the PBT_APMQUERYSUSPEND event from the application's message queue. If an application does not remove the message from its queue in less then 20 seconds, the system will assume that the application is in a non-responsive state, and that the application agrees to the sleep request. Applications that do not process their message queues may have their operations interrupted. After it removes the message from the message queue, an application can take as much time as needed to perform any required operations before entering the sleep state. Any operations that could take longer then 20 seconds should be performed at this time, since the system allows only 20 seconds for operations to complete during PBT_APMSUSPEND processing.
Windows NT/2000: Requires Windows 2000.
Windows 95/98: Requires Windows 95 or later.
Header: Declared in Pbt.h.
Power Management Overview, Power Management Events, WM_POWERBROADCAST