On May 27, 2018, at 6:36 AM, Ram Rachum <r...@rachum.com> wrote:
> 
> I'd like to use the `wmi` module to detect when a window with the title "Foo 
> Bar" was created, and then kill the process that created this window. Is this 
> possible?

Not with WMI, no.


> (I can do the killing without `wmi`, I just need to ID the process.)
> 
> Note that I don't want to be periodically polling for that window, I want to 
> be listening to an event so there wouldn't be a big delay.

I don't know how much overhead you are willing to impose, but you can always 
install a WH_CALLWNDPROC window hook and look for WM_CREATE messages.  That 
injects a DLL into every process in the system, so I'm not convinced it can be 
done with Python.  You may need to write a C++ DLL and have it communicate with 
your Python process.
— 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
https://mail.python.org/mailman/listinfo/python-win32

Reply via email to