[python-win32] Solid Example of Inputting Text into Win32 App?

Tim Roberts timr at probo.com
Mon Apr 26 20:28:15 CEST 2010


Christopher Evans wrote:
> Anyone have a link to a solid example of this?
>
> I am opening an app that is a single window with an internal console.
> It uses a different scripting language than python, but I would like
> to enter text into it (maybe make a wrapper later).

What do you mean by "internal console"?  If it is a GUI app, with a text
control displayed in a window, then you can't use pipes to send the
data.  You must use something like FindWindow to locate the top-level
window, then GetDlgItem to get the window handle of the text control
itself, then use SetWindowText or send a WM_SETTEXT message to change
the text as displayed.

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



More information about the python-win32 mailing list