[Python-au] win32gui question

Mark Hammond mhammond at skippinet.com.au
Mon Apr 18 04:40:22 CEST 2005


> I'm new to the list, and new to python for that matter.
> I have a question regarding the win32gui module/win32 extensions.

You may find more luck on the python-win32 at python.org mailing list.

> A concern was raised that edit boxes would not be able to be
> distinguished because
> it was not possible to name an edit box without the name
> appearing in the edit box.
> Writing a small MFC app with a single richedit box, I was
> able to name the edit box
> using python by calling win32gui.SetWindowText() and it would
> not show up in the
> box, and I was able to verify the caption of the edit box using Spy++.

That surprises me.  My experience has always been that SetWindowText will
set the text of the control itself.  The MS documentation for SetWindowText
also states this.

> What I'd like to know is: What is win32gui.SetWindowText
> actually doing so we can do
> the same thing in the MFC code so that  the gui will have all
> the controls named on
> startup?

win32gui.SetWindowText is calling the SetWindowText() API function - no more
and no less.  You should be able to call this function passing the handle of
your MFC window.

Mark




More information about the python-au mailing list