I'm writing a program and I want it to stop working when user is Locking his account. Can I somehow get those informations? I've tried to google it, but I couldn't find an answer.
Asked
Active
Viewed 40 times
0
-
See https://stackoverflow.com/questions/12293286/how-to-get-windows-unlock-event-in-c-sharp-windows-application – Jtbs Mar 04 '18 at 21:40
-
Note that as per the linked question, the [SystemEvents.SessionSwitch event](http://msdn.microsoft.com/en-us/library/microsoft.win32.systemevents.sessionswitch.aspx) provides a [SessionSwitchReason](https://msdn.microsoft.com/en-us/library/microsoft.win32.sessionswitchreason(v=vs.110).aspx), you will want to look for SessionLock (and SessionUnlock if you want to resume automatically) – stuartd Mar 04 '18 at 21:49