October 23, 2011

ThaRez ThaRez
Lab Rat
71 posts

How to tell when user locks computer (windows)?

 

Hello I’m wondering how to tell when the user locks the computer (windows xp, vista & 7). My intention is to create a small app that that logs the time the computer is locked and unlocked. So I need to know how to tell when the user locks the computer so it can log the time. Thank you!
Best regards
Richard

2 replies

October 24, 2011

Lukas Geyer Lukas Geyer
Lab Rat
2068 posts

You will have to use platform-specific code. Take a look at WTSRegisterSessionNotification [goo.gl] and WM_WTSSESSION_CHANGE [goo.gl].

October 31, 2011

maxvanceffer maxvanceffer
Lab Rat
48 posts

Lukas can u provide simple example how to use it, pls ?

 
  ‹‹ difference between my code and testcon code      [Solved] Creating Windows Services (Nt Services) using Qt ››

You must log in to post a reply. Not a member yet? Register here!