Take a look at c-sharp-detect-time-of-last-user-interaction-with-the-os which uses GetLastInputInfo functionand also SystemParametersInfo function retrieving SPI_GETSCREENSAVETIMEOUT.
How to get the time left from a Windows Session before the active user is locked out of a session?
Antonio Arocha
21
Reputation points
Hello:
I would like to know, how much time is left before a user is locked out of it's current windows session in c#.