Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Shaun E on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to search a window to a certian text box

Status
Not open for further replies.

3212333222355

Programmer
Jun 29, 2005
3
US
Hello, im new to these here forums but im an experienced Delphi programmer. So wud up~

I was wanting to search all the child windows of a parent for specific text.

Perhaps I can for loop through all the Child Windows, and use GetWindowText() to check the text in it, but I do not know how to get all the child windows of a parent.

Any help?
 
use the findwindow and findwindowex functions in conjunction. look here for an example : thread102-743831

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Hmn, but thats working with MDI forums -iv'e never worked wih them

Do you think you (someone) can post an example on how get every child window of a parent, and store it in an array oh HWND? like

Children:Array of HWND;

Then from there I can loop through them and check the text using GetWindowText();

thx :D
 

It is not clear what exactly you are working with. To get the text of all of the TEdit components on a form, you can use something like this:
Code:
procedure TForm1.Button1Click(Sender: TObject);
var
  i:integer;
begin
  for i := 0 to ComponentCount - 1 do
    if Components[i] is TEdit then
      ShowMessage( TEdit(Components[i]).Text );
end;
If that is not what you mean, perhaps you can provide a few more details.

 
heh yeah thats alot easeir because you own the forum, just use Form1.Components[] and loop through them :)

But what I am specificly working with is "other forums" - within an application I do not own, such as Internet Explorer.
 
Do you think you (someone) can post an example on how get every child window of a parent, and store it in an array oh HWND?

Have you actually tried the suggestion that whosrdaddy gave you? Try it and then post here if you have problems.

Have a look at this link if you're struggling:
Hope this helps!

Clive [infinity]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
"To err is human, but to really foul things up you need a computer."
Paul Ehrlich
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To get the best answers from this forum see: faq102-5096
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top