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

适用于

另请参阅