|
-
January 24th, 2007, 09:58 PM
#1
How do you find a child window within a toplevel window's complete tree?
How do you find a child window within a toplevel window's complete tree?
I want to know if I am reinventing the wheel here.
I've come up with a cool function while working on a new class, that finds any child window, by its text or classname, within a main window.
It searches through each layer first, before moving on to the next smaller branch, or layer of windows.
The call looks like this:
Code:
Dim swnd As Integer = SendClicks.GetHandle("Form1", "Start")
No matter where the window with the text "Start" is, the function will return the handle to it.
You can specify an index, in case more than one window matches the specification.
Code:
Dim swnd As Integer = SendClicks.GetHandle("Form1", "Start", "5" )
This will obtain the 5th window matching the "Start" string.
The index follows the layers, of branches.
It prefers the closest window to the main window.
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
|