Kelie wrote: > Thank you Tim and Mark. After trying what was suggested by you (both > work), I realized it is not what I was looking for. What I wanted to > do is: for every 0.1 second, check the active application or current > application, or active window? (I don't know what is the correct > term.) if it is AutoCAD (meaning user is using AutoCAD), turn on the > CapsLock, if it is Microsoft Word (meaning user is using Word), turn > off the CapsLock. >
I think win32gui.GetForegroundWindow is what you're looking for. >From the MSDN docs: The GetForegroundWindow function returns a handle to the foreground window (the window with which the user is currently working). hth Roger _______________________________________________ Python-win32 mailing list Python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32