PowerManager.UserPresenceStatusChanged 事件

定義

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

// 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

適用於

另請參閱