New win32 How-Do-I on monitoring session events
Thanks to sterling work by Klaas “le dahut” Tjebbes on the python-win32 list, we now have a how-do-I? example on how to keep track of session events: logon/logoff, screensaver cut-in/cut-out and shell startup: http://timgolden.me.uk/python/win32_how_do_i/track-session-events.html
ziga said,
Wrote on April 19, 2010 @ 6:59 pm
You can receive session events also by using terminal services API, namely win32ts.WTSRegisterSessionNotification(), which is useful when not running as a service.
Terminal services API also has other useful functions that simplify session and user management, such as WTSQuerySessionInformation() and WTSQueryUserToken().