Phung Thuy Vuong wrote: > > Can anyone give me some hint please? I'm trying to make a log file > which keep track of a specific application. For example, I need to > punch the time et date where an application, such as Firefox, is > opened and when it's closed. I also need to detect when the > application goes to idle and when it's re-activate again. (I hope my > question it's clear enough.) Thank you!
What you ask is complicated. You need to install a "window hook" to intercept the activate and deactivate messages going to all of the top-level windows in the system. The reason it's complicated is because of the way window hooks work. Your code must live in a DLL, and that DLL is injected into every process in the system. Thus, such a thing cannot be written in Python. You could certainly have a simple hook DLL that reports statistics back to some Python server "mother ship". There are several web articles on writing window hooks. -- Tim Roberts, t...@probo.com Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32@python.org http://mail.python.org/mailman/listinfo/python-win32