Valhalla Legends Archive

Programming => General Programming => Topic started by: hismajesty on May 30, 2004, 01:00 PM

Title: Getting Control Caption
Post by: hismajesty on May 30, 2004, 01:00 PM
This is probably pretty easy but I can't figure it out. I'm trying to get the caption of the things boxed in in red Here (http://www.digitaldoozie.net/images/rhapsodydev.png).

I looked it up in Spy++ and got t he name of the controls and what type of controls they are. They're all text boxes so I was hoping it'd be pretty easy. However, every item in the program uses the same class (TEST_WIN32WND) as opposed to a program like Notepad which has seperate ones and makes it easy :P. Since each control uses the same class how can I say which one I want the caption of? I had planned to use FindWindowEx for the textbox but since the class is widespread that won't work I don't think. I asked a few other people and the best advice I got was from xp - "Get a media player that doesn't suck." Any suggestions?
Title: Re:Getting Control Caption
Post by: K on May 30, 2004, 03:30 PM
You need to determine what order the textboxes were created in, and then call FindWindowEx() with the siblings that number of times.  Alternatively, you can use a code-generating API spy which will do this for you and generate (unfortunantly VB , but its easily adaptable) the code to grab the handle of the window.  
Here's a good one: http://www.patorjk.com/progapispy.htm
Title: Re:Getting Control Caption
Post by: hismajesty on May 30, 2004, 03:47 PM
Thanks, I'll look into that.
Title: Re:Getting Control Caption
Post by: Adron on June 08, 2004, 05:06 AM
Quote from: hismajesty[yL] on May 30, 2004, 03:47 PM
Thanks, I'll look into that.

Did it work?
Title: Re:Getting Control Caption
Post by: hismajesty on June 18, 2004, 04:40 PM
No.
Title: Re:Getting Control Caption
Post by: Adron on June 18, 2004, 07:28 PM
I sometimes use the coordinates to identify which one I'm after.