Search code examples
c++windowswinlogon

How to detect the event when a user is logging on?


Is there a way to detect when a user is logging on a system? I found a method as described here: http://msdn.microsoft.com/en-us/library/windows/desktop/aa375405(v=vs.85).aspx but it doesn't work on Windows Vista and hihgher. So does anyone has an idea how to do it?

Thanks!


Solution

  • Looks like WTSWaitSystemEvent with WTS_EVENT_LOGON might be what you are looking for.