[python-win32] Detect when the user launches or closes a program?

Patrick Li patrick at gxlinc.com
Tue Nov 20 00:15:33 CET 2007


Hi,

I am trying to write a program that will perform some operation on the
user's computer when the user launches a particular executable(s) on the
computer and when the user closes them.

One way to achieve this is by polling the process table periodically and
checking to see if one of the running processes matches the executable name
that I am looking for.  However, I would much prefer not polling so
frequently as it seems to be a waste of user's system resource.

Does anyone know if there is a way to hook a callback to windows where it
will trigger my function when windows launches a particular program?  I
think that would be the ideal thing to do if that is available.

Thanks.
Patrick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20071119/8504ea99/attachment.htm 


More information about the python-win32 mailing list