[python-win32] Child Windows

João Abrantes jepe_abrantes at hotmail.com
Wed Apr 9 21:11:41 CEST 2008


=D thanks! just one more thing.. how do i found the controls ids of a certain application?



> Date: Tue, 8 Apr 2008 14:53:40 -0700
> From: timr at probo.com
> To: python-win32 at python.org
> Subject: Re: [python-win32] Child Windows
> 
> João Abrantes wrote:
> > Hello,
> >
> > I am trying to make a program that sends text to notepad using 
> > win32api.SendMessage function. The thing is that I don't know how to 
> > get the notepad child window edit handler and I can't find any 
> > documentation about win32 (python) can you help me?
> 
> Mark Hammond wrote a book on using Python with Win32.  Google has lots 
> of information about it.  In large part, however, you are expected to be 
> pretty comfortable with the Win32 API, and if you are, then figuring out 
> the Python translations isn't that hard.
> 
> In the meantime can use win32api.FindWindow.  The "edit" within Notepad 
> had control ID 0x0f.  So, start up an empty Notepad.  Then:
> 
>     import win32gui
>     import win32con
>     notepad = win32gui.FindWindow( None, "Untitled - Notepad" )
>     npedit = win32gui.GetDlgItem( notepad, 0x000f )
>     win32gui.SendMessage( npedit, win32con.WM_SETTEXT, 0, "Testing" )
> 
> -- 
> Tim Roberts, timr at probo.com
> Providenza & Boekelheide, Inc.
> 
> _______________________________________________
> python-win32 mailing list
> python-win32 at python.org
> http://mail.python.org/mailman/listinfo/python-win32

_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20080409/72198cab/attachment.htm 


More information about the python-win32 mailing list