• Welcome to Valhalla Legends Archive.
 

Getting Control Caption

Started by hismajesty, May 30, 2004, 01:00 PM

Previous topic - Next topic

hismajesty

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.

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?

K

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

hismajesty

Thanks, I'll look into that.

Adron


hismajesty


Adron

I sometimes use the coordinates to identify which one I'm after.