[python-win32] lock workstation

2007-10-11 Thread kNish
Hi, Need : To track time when a workstation is locked and when it is unlocked. Store this time. My approach : 1st Option Trap the key ctrl+alt+del or windows+l. trigger a procedure to save the time in and time out into a database.

Re: [python-win32] lock workstation

2007-10-11 Thread Steven James
Never tried it, but you might want to see if WTSRegisterSessionNotification [ http://msdn2.microsoft.com/en-us/library/aa383841.aspx] works in the python win32 API. You can register your window to receive notification automatically when a user logs in, logs out, locks the machine, unlocks, etc.

Re: [python-win32] lock workstation

2007-10-11 Thread Tim Roberts
kNish wrote: Need : To track time when a workstation is locked and when it is unlocked. Store this time. My approach : 1st Option Trap the key ctrl+alt+del or windows+l. trigger a procedure to save the time in and time out into a database. You can't trap

Re: [python-win32] lock workstation

2007-10-11 Thread Tim Golden
Tim Roberts wrote: The usual way to determine whether the desktop has been locked is to call OpenDesktop on the desktop called default, and then try to use SwitchDesktop to switch to it. If the SwitchDesktop fails, then the workstation is locked. There's an example in Delphi here:

Re: [python-win32] lock workstation

2007-10-11 Thread Tim Roberts
Tim Golden wrote: Tim Roberts wrote: The usual way to determine whether the desktop has been locked is to call OpenDesktop on the desktop called default, and then try to use SwitchDesktop to switch to it. If the SwitchDesktop fails, then the workstation is locked. There's an example in