[python-win32] Wait for a window with a specified title

Tim Roberts timr at probo.com
Mon May 28 01:33:01 EDT 2018


On May 27, 2018, at 10:19 PM, Ram Rachum <ram at rachum.com> wrote:
> 
> Oh, that sounds heavy. I guess I'm back to polling. Any idea how to do this with polling? 

It would be easy with polling.  You'd use EnumWindows to go through the list of all top-level windows, GetWindowText to get the window title, GetWindowThreadProcessId to convert the window handle to a process ID.

You may not actually need the process ID.  You could just send a WM_CLOSE message to the window.  Unless the process is trying to protect itself, that's usually enough.
— 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-win32/attachments/20180527/1dd7d6ca/attachment.html>


More information about the python-win32 mailing list