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 ctrl+alt+del. That is one of the key security rules of Windows. The whole purpose of ctrl+alt+del is to have a key sequence which is guaranteed to go straight to the operating system, without any traps or bypasses, so that the user can be confident there are no Trojans in the way before entering a password. > 2nd Option > > Run a procedure that has a while true loop. In this loop > there can be a event capture device to know that a ctrl+alt+del has > been pressed. > > Now run the save to database procedure. > > I think of doing this using python, tkinter, ctype opendesktop. 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: http://www.delphipages.com/threads/thread.cfm?ID=145214&G=145213 and one in Visual Basic here: http://gethelp.devx.com/techtips/nt_pro/10_minute_solutions/10minNT0701-4.asp -- Tim Roberts, [EMAIL PROTECTED] Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32