| || |
Get the active MDI child of an open VB6 applion
In converting my scripts from a closed application to an open application I came across the following problem.
I need the current active mdi child from the active MDI parent.
How do I do this?
The reason I need this is because my code is very general for multiple windows (50+) and I do not want to reprogram this again.
Re: Get the active MDI child of an open VB6 applion
Here is a sample script demonstrating how to do this:
<font class="small">Code:</font><hr /><pre>Function GetActiveMDIWindow(process)
' searching for a focused window
Set object = process.FindChild("Focused", True, 1000)
' processing the search results
Do While Not (object Is Nothing)
If Not object.Exists Then
If IsSupported(object, "MDIChild") Then
If object.MDIChild Then
Set GetActiveMDIWindow = object
Set object = object.Parent
Set GetActiveMDIWindow = Utils.CreateStubObject()
Set p = Sys.Process("Process")
Set object = GetActiveMDIWindow(p)
If object.Exists Then
Log.Message("Found: " + object.FullName)