[python-win32] Using Flexible Win32 message pump to monitor window open/close for all application?

Tim Roberts timr at probo.com
Thu Mar 31 01:17:01 CEST 2011


reckoner wrote:
> Which is listed in the Python cookbook, second edition. Is it possible 
> to use this to monitor the open/close of different windows? Basically, I 
> would like to trigger an action for a specific window or handle when 
> that window class or handle opens/closes. Can this recipe help with 
> that? Any ideas on getting started with this?

Do you mean a window in another application?  That requires installing a
Windows hook, and a Windows hook callback must reside in a DLL (so that
DLL can be injected into the other process), which cannot be done in
Python.  There is the pyHook package, but I don't know if it is still
being developed.

http://www.cs.unc.edu/Research/assist/developer.shtml

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list