
August 26th, 2003, 07:38 PM
|
|
Junior Member
|
|
Join Date: Jul 2003
Posts: 2
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Controlling Windows Controls using API
OK I am using the FindWindowEx and EnumerateChild and Sendmessage APIs to control a couple of combo boxes. I have been able to control them unless there is another control with the same classname in the same window. The controls do not have any text to identify them either other than the class name. For some reason, I cannot locate its handle
First I am locating the window that I need. For instance an IE window's address bar. Then I am Enumerating through the Child Controls Until I locate the class name that I need (ie. RebarWindow32, then ToolbarWindow32, ComboBox32, ComboBox, and finally the Edit Class)
I then use the SendMessage API to read or write the contents of the text box and it works great! Unless there is one of those search bars installed, like Google or a Websters Dictionary Search bar or something. They have the same class name and it only recognizes one (always the wrong one).
I am having this same problem in controlling another application I am writing this for in which there are several Combo Boxes on an SSTab control. I used APISpy 2.7 and it gave me the classnames which are all the same as well as nothing for the controls text.
Any Idea how I can locate the handle for controls that seem Identical? I thought of testing for the Top, Left Width and Height properties but this will not work in IE as they can take any place/size.
Any suggestions would be greatly appreciated.
Thanx!!
|