Click to See Complete Forum and Search --> : Controls Text Strings


Seanfhear
April 11th, 1999, 03:28 PM
How can I retrieve at runtime the complete list of the text strings for a dialog's controls , INCLUDING the static text controls? I don't wish to be troubled with which of several foreign languages is in force.
The only way I seem to be able to do it is by making the static text controls tabbable and using the GetNextTabItem (or something). But this means that User has to tab through the text!

Dave Lorde
April 12th, 1999, 05:15 AM
What about cycling through the child windows using GetWindow, and doing GetWindowText on them?

Dave

Seanfhear
April 13th, 1999, 04:00 PM
My problem is that I want this to be a generic procedure to work with ANY dialog, so I dont have a way of getting a list of the child windows - ie I don't know their resource symbols!!!

Masaaki
April 13th, 1999, 04:16 PM
Hi.

Fisrt, try to check the control situation on Dialog by SPY++.
So, you notice something like this.
Only static text control and button have Window caption. The
other control window caption is always "".

So, after you get CWnd of any dialog by FindWidnow, you can get
all CWnd of child control by GetTopWindow and GetWindow inside
loop. You need CWnd array.
And you get Window caption by GetWidnowText. Only static and button control have Window caption.After this, you can get string length
by some CString function.(I forget)

Hope for help.
-Masaaki Onishi-

Dave Lorde
April 14th, 1999, 03:58 AM
You don't need their resource symbols if you use CWnd::GetWindow. GW_CHILD gives you the first child, GW_HWNDFIRST gives you the first sibling, GW_HWNDNEXT gives you the next.

Dave