Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

PowerRegisterSuspendResumeNotification function

Registers to receive notification when the system is suspended or resumed.

Syntax


DWORD WINAPI PowerRegisterSuspendResumeNotification(
  _In_  DWORD         Flags,
  _In_  HANDLE        Recipient,
  _Out_ PHPOWERNOTIFY RegistrationHandle
);

Parameters

Flags [in]

This parameter must be DEVICE_NOTIFY_CALLBACK.

Recipient [in]

This parameter is a pointer to a DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS structure. In this case, the callback function is DeviceNotifyCallbackRoutine. 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.

RegistrationHandle [out]

A handle to the registration. Use this handle to unregister for notifications.

Return value

Returns ERROR_SUCCESS (zero) if the call was successful, and a nonzero value if the call failed.

Requirements

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

Powerbase.h

Library

Powrprof.lib

DLL

Powrprof.dll

See also

PowerUnregisterSuspendResumeNotification
DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS
DEVICE_NOTIFY_CALLBACK_ROUTINE

 

 

Community Additions

ADD
Show:
© 2015 Microsoft