PowerManager.DisplayStatusChanged 事件

定義

當與應用程式會話相關聯的顯示狀態已變更時引發。

// Register
static event_token DisplayStatusChanged(EventHandler<IInspectable> const& handler) const;

// Revoke with event_token
static void DisplayStatusChanged(event_token const* cookie) const;

// Revoke with event_revoker
static PowerManager::DisplayStatusChanged_revoker DisplayStatusChanged(auto_revoke_t, EventHandler<IInspectable> const& handler) const;
public static event System.EventHandler<object> DisplayStatusChanged;
function onDisplayStatusChanged(eventArgs) { /* Your code */ }
Microsoft.Windows.System.Power.PowerManager.addEventListener("displaystatuschanged", onDisplayStatusChanged);
Microsoft.Windows.System.Power.PowerManager.removeEventListener("displaystatuschanged", onDisplayStatusChanged);
- or -
Microsoft.Windows.System.Power.PowerManager.ondisplaystatuschanged = onDisplayStatusChanged;
Public Shared Custom Event DisplayStatusChanged As EventHandler(Of Object) 

事件類型

備註

若要取得顯示目前的狀態以回應此事件,請使用 DisplayStatus 屬性。 此事件會對應至 GUID_SESSION_DISPLAY_STATUS電源設定 GUID

適用於

另請參閱