[python-win32] help writing text to a windows edit control

Tim Roberts timr at probo.com
Thu Mar 25 20:29:12 CET 2010


Richard Leahy wrote:
> Hi  Tim its just a C windows gui application that consists of a edit
> control and a button. I am just trying to write my text string to the
> edit control i can write to the button and i know i have found the
> right control id for the edit control to but for some reason it just
> does not want to work. thanks for your help.

Well, I'm not sure I understand why, but "SetDlgItemA" does not work
with your edit control and "SendMessage" does:

import win32gui
WM_SETTEXT = 0x0c
t = win32gui.FindWindow( None, "Windows App" )
t1 = win32gui.GetDlgItem( t, 1 )
print win32gui.SendMessage( t1, WM_SETTEXT, 0, "444")

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



More information about the python-win32 mailing list