// https://stackoverflow.com/questions/44980/programmatically-determine-a-duration-of-a-locked-workstation protected override void OnSessionChange(SessionChangeDescription sessionChangeDescription) { SessionSwitchMonitor.SystemSessionSwitch(sessionChangeDescription.SessionId, (SessionSwitchReason)sessionChangeDescription.Reason); }
protected static void SystemEvents_SessionSwitch(object sender, SessionSwitchEventArgs e) { // This is a direct copy of HideezServiceHost.HideezService.OnSessionChange SessionSwitchMonitor.SystemSessionSwitch(System.Diagnostics.Process.GetCurrentProcess().SessionId, e.Reason); }