But what about the name of the user? |
| Shekhar Somani replied to alice johnson at 05-Jul-08 05:22 |
Thank you Alice. Actually, I already know how to receive and handle WM_WTSSESSION_CHANGE message. I am also aware of wParam values like WTS_CONSOLE_CONNECT and WTS_SESSION_UNLOCK and others.
My problem is, to know WHICH user has unlocked the computer. Let me explain...
1) User A turns the computer on and logs on 2) He hibernates/locks the computer 3) User B comes and logs on (User A is still there in inactive state) 4) User B locks the computer 5) User A unlocks the computer
Now in case 1 and 5, the User A has activated the computer, this is ONLY what I need to know. WM_WTSSESSION_CHANGE message in conjunction with WTS_SESSION_UNLOCK value can be used, but it would not let me know whether it is User A or User B who has unlocked the computer.
Also let me specify why I need this, I am working on a utility that gives some information, plays custom random sound, etc. whenever a user unlocks the computer. Since in everyday home use, we don't log off. Instead, the last user who used the computer puts it in Standby or Hibernate mode, so mostly all the users are in "logged on" mode every time. Now I don't want my program to play the sounds for every user! It should be done only for a particular user.
I hope this somewhat long explanation gives an idea what I need. I think this is somewhat rare requirement. Now can u (or anyone else) help?
|
|