PowerRegisterSuspendResumeNotification 函式 (powerbase.h)

註冊以在系統暫停或繼續時接收通知。

語法

DWORD PowerRegisterSuspendResumeNotification(
  [in]  DWORD         Flags,
  [in]  HANDLE        Recipient,
  [out] PHPOWERNOTIFY RegistrationHandle
);

參數

[in] Flags

此參數必須 DEVICE_NOTIFY_CALLBACK

[in] Recipient

此參數是 DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS 結構的指標。 在此情況下,回呼函式為 DeviceNotifyCallbackRoutine。 當 Callback 函式執行時, 會設定 Type 參數,指出發生的事件種類。 可能的值包括 PBT_APMSUSPENDPBT_APMRESUMESUSPENDPBT_APMRESUMEAUTOMATIC - 如需詳細資訊,請參閱 電源管理事件設定參數不會與暫停/繼續通知搭配使用。

[out] RegistrationHandle

註冊的控制碼。 使用此控制碼取消註冊通知。

傳回值

如果呼叫成功,則傳回ERROR_SUCCESS (零) ,如果呼叫失敗,則傳回非零值。

需求

   
最低支援的用戶端 Windows 8 [僅限傳統型應用程式]
最低支援的伺服器 Windows Server 2012 [僅限傳統型應用程式]
目標平台 Windows
標頭 powerbase.h
程式庫 Powrprof.lib
Dll Powrprof.dll

另請參閱

DEVICE_NOTIFY_CALLBACK_ROUTINE

DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS

PowerUnregisterSuspendResumeNotification