[python-win32] questions
Tim Roberts
timr at probo.com
Mon Mar 7 15:51:43 EST 2016
Jon Joseph wrote:
>
> To Whom It May Concern: Is there any semi-comprehensive resource on
> how to use win32gui or any of the other win32* modules? As a
> beginning example I’m just trying to:
>
> 1) Open notepad (done)
>
> 2) Automatically File->Exit
>
>
>
> A simple demo would be helpful.
>
The Win32 modules are a Python binding of the Windows API. If you know
how to do this in the Windows API, then it's a pretty straightforward
mapping into Python. If you don't know the Windows API, then you're
climbing two learning curves at once.
How are you opening Notepad? There are several ways to do that, both
with in native Python and in the API.
To do #2, you can use win32ui.FindWindow to find the Notepad window
handle, then use win32gui.PostMessage to send a WM_CLOSE message to that
window.
--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.
More information about the python-win32
mailing list