|
-
April 11th, 1999, 03:28 PM
#1
Controls Text Strings
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!
-
April 12th, 1999, 05:15 AM
#2
Re: Controls Text Strings
What about cycling through the child windows using GetWindow, and doing GetWindowText on them?
Dave
-
April 13th, 1999, 04:00 PM
#3
Re: Controls Text Strings
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!!!
-
April 13th, 1999, 04:16 PM
#4
Re: Controls Text Strings
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-
-
April 14th, 1999, 03:58 AM
#5
Re: Controls Text Strings
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
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|