Private Sub SystemEvents_SessionSwitch(ByVal sender As Object, ByVal e As Microsoft.Win32.SessionSwitchEventArgs) Try Select Case e.Reason Case Microsoft.Win32.SessionSwitchReason.SessionLock ClientStatus(MBSMessage.ClientStatus.Locked) UserLockUnlockSettingUPdate(MBSMessage.ClientStatus.Locked) timerMessageRecurrance.Stop() Exit Select Case Microsoft.Win32.SessionSwitchReason.SessionUnlock, Microsoft.Win32.SessionSwitchReason.ConsoleConnect, Microsoft.Win32.SessionSwitchReason.RemoteConnect timerMessageRecurrance.Start() ClientStatus(MBSMessage.ClientStatus.Login) UserLockUnlockSettingUPdate(MBSMessage.ClientStatus.Login) Exit Select Case Microsoft.Win32.SessionSwitchReason.SessionLogoff ClientStatus(MBSMessage.ClientStatus.LogOff) timerMessageRecurrance.Stop() Exit Select 'added this logon case for DISPLAY_ALERT_DELAY_DURATION feature to work Case Microsoft.Win32.SessionSwitchReason.SessionLogon timerMessageRecurrance.Start() ClientStatus(MBSMessage.ClientStatus.Login) Exit Select Case Microsoft.Win32.SessionSwitchReason.RemoteDisconnect ClientStatus(MBSMessage.ClientStatus.LogOff) timerMessageRecurrance.Stop() Exit Select End Select
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)