There is an application on WinForms. The user logs in and remains in the system. After 5 min. Absence You need to block the program for the conversion and continue working from the same place or enter a new user. How to track down time for blocking and unlock?

  • we have the right to determine the absence of the user, as the absence of events in the forms of the application from the keyboard and mouse? or need to track more globally? - rdorn
  • just if you stopped working with the program and it’s time gone by - Stolborez
  • You can try to record the action time by events related to the user's actions and check the timer by how much time, for example, once a minute. Or, for the same events, restart the timer at a specified interval, but I like the first option more. If it fits, I will arrange it as an answer - rdorn 1:58 pm
  • one
    You can try to subscribe to MouseMove and KeyPress form events. And for them to reset the timer. Accordingly, if the timer is triggered (after the time expires), lock the entire contents of the form and display the password entry field for unlocking. - Alexey
  • one
    GetLastInputInfo - NMD

0