PowerManager.UserPresenceStatusChanged 事件
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
當與應用程式會話相關聯的用戶狀態已變更時引發。
// Register
static event_token UserPresenceStatusChanged(EventHandler<IInspectable> const& handler) const;
// Revoke with event_token
static void UserPresenceStatusChanged(event_token const* cookie) const;
// Revoke with event_revoker
static PowerManager::UserPresenceStatusChanged_revoker UserPresenceStatusChanged(auto_revoke_t, EventHandler<IInspectable> const& handler) const;
public static event System.EventHandler<object> UserPresenceStatusChanged;
function onUserPresenceStatusChanged(eventArgs) { /* Your code */ }
Microsoft.Windows.System.Power.PowerManager.addEventListener("userpresencestatuschanged", onUserPresenceStatusChanged);
Microsoft.Windows.System.Power.PowerManager.removeEventListener("userpresencestatuschanged", onUserPresenceStatusChanged);
- or -
Microsoft.Windows.System.Power.PowerManager.onuserpresencestatuschanged = onUserPresenceStatusChanged;
Public Shared Custom Event UserPresenceStatusChanged As EventHandler(Of Object)
事件類型
備註
若要取得目前用戶狀態以回應此事件,請使用 UserPresenceStatus 屬性。 此事件會對應至 GUID_SESSION_USER_PRESENCE電源設定 GUID。
適用於
另請參閱
- UserPresenceStatus
- UserPresenceStatus
- 使用應用程式生命週期 API
電源管理