RegisterSuspendResumeNotification function
Registers to receive notification when the system is suspended or resumed. Similar to PowerRegisterSuspendResumeNotification, but operates in user mode and can take a window handle.
Syntax
HPOWERNOTIFY WINUSERAPI RegisterSuspendResumeNotification( _In_ PDEVICE_NOTIFY_SUBSCRIBE_PARAMETERS hRecipient, _In_ DWORD Flags );
Parameters
- hRecipient [in]
-
Contains parameters for subscribing to a power notification or a window handle representing the subscribing process.
When the Callback function executes, the Type parameter is set indicating the type of event that occurred. Possible values include PBT_APMSUSPEND, PBT_APMRESUMESUSPEND, and PBT_APMRESUMEAUTOMATIC - see Power Management Events for more info. The Setting parameter is not used with suspend/resume notifications.
- Flags [in]
-
This parameter must be DEVICE_NOTIFY_CALLBACK.
Return value
A handle to the registration. Use this handle to unregister for notifications.
If the function fails, the return value is NULL. To get extended error information call GetLastError.
Requirements
|
Minimum supported client | Windows 8 [desktop apps only] |
|---|---|
|
Minimum supported server | Windows Server 2012 [desktop apps only] |
|
Header |
|
|
Library |
|
|
DLL |
|
See also
- UnregisterSuspendResumeNotification
- DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS
- DEVICE_NOTIFY_CALLBACK_ROUTINE
Send comments about this topic to Microsoft
Build date: 10/26/2012
