[python-win32] Using WMI to listen to window creation and destruction

Ram Rachum ram at rachum.com
Wed Jul 18 15:14:12 EDT 2018


"Are you really looking to monitor the creation of new top-level windows,
which means the creation of new processes?"

Does that apply to explorer windows? (i.e. when you open a new folder.)
Because that's what I'd like to listen to.

On Wed, Jul 18, 2018 at 9:45 PM, Tim Roberts <timr at probo.com> wrote:

> Ram Rachum wrote:
> >
> > I'd like to use the `wmi` module to be notified on the events of a
> > window being created or destroyed. Is this possible? I looked at the
> > tutorial and cookbook and could find many interesting things, but not
> > that.
>
> I don't think WMI provide information about windows, although admittedly
> I've underestimated WMI in the past.  If you have evidence to the
> contrary, please correct me.
>
> However, I'm pretty sure what you said is not really what you meant.
> Remember that every control, every button, every textbox, every icon --
> really, every visible thing is a separate window.  You'd get thousands
> of hits.  Are you really looking to monitor the creation of new
> top-level windows, which means the creation of new processes?  Because
> WMI DOES provide information about processes.
>
> If you do want to find out about windows, you'd need to use a Windows hook.
>
> --
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
>
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> https://mail.python.org/mailman/listinfo/python-win32
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20180718/a2cc5690/attachment.html>


More information about the python-win32 mailing list