Jump to content
Sign in to follow this  

Script for capturing & displaying information regarding a specified main window & its child windows (including its GUI components)

Recommended Posts



I am planning to create a script......

Expected Input: Main Window Title or Main Window Process ID

Expected Output:

1. Main window ID: XXXXX (required)

2. Number of Child Windows opened by that main window: XXXXX (required)

3. Window Title of the Active Child Window: XXXXX (required)

4. Number of GUI Components in Main Window: XXXX (ex: 1 TOOLBAR, 3 TEXTBOX, 5 COMBOBOX etc)

5. GUI Component Type & GUI Control Id in that Child Window: (required)

Number of GUI Components in Child Window: XXXX (ex: 1 TOOLBAR, 3 TEXTBOX, 5 COMBOBOX, 1 BUTTON etc)

GUI Component Types, its content(TEXTBOX & LABEL only), its Control Id & coordinates in active Child Window:XXXXX (ex: COMBOBOX:2200,x20y0,

TEXTBOX(Hello world):3300,x30y30, LABEL:(Message)3300,x0y0)

I have already created a script that can simulate key board activities.....i used to use window title to pass the control to newly popped up child window....But unfortunately i am facing a kind of window whose title is generated in random....so my script cannot determine which child window it should use for next set of actions......If i can get the above mentioned information about the child window atleast i can add more features that will simply count or capture the newly popped up window (not by its title)....by its PID or control ID.......

I am not expecting any perfect help...I just know what i need but i am not that expert in autoIt & net is so huge to get the right answer...if possible just give me any good starting somewhat like...

1. How can my script sense a newly popped up window (not by its title using WinWait()) ?

2. How can i get the control id of the GUI components in child window (previously i used to use AutoIt Window Info, but now my network admin has installed mcAfee which i believe scrambles the Control ID's making it random after a certain period of time, so my script makes use of TAB and Arrow key actions to navigate the entire GUI components which is terrible if the movement delay is interrupted by any external event) ?

My current script can automate data entry in an old C built system using keyboard simulations (makes the automation difficult).

Its Input is : a text file containing key board actions, values, child windows to be taken care of.. etc.

1. While executing i need to make the desired window active by mouse click

2. I wont be able to do any thing in my PC till the script finishes (Any suggestions to freeze the window so that i can browse net at the same time.....I am planning to do this on VMWare, but the memory is gonna cry ????)

The below is the sample language which is the input....the script file works like a compiler that will understand what keyboard actions (luckily the system has some pre built keyboard actions that allows to manipulate GUI actions without the mouse) i want to do with the GUI






WIN=Marketing Location Number One - PP/1/CM\Create CCF






CW1=Create CCF


















ROAD 512,$TB








where $TB is TAB, $ER is ENTER, WIN will take care of main window......while rest of all are data to be entered, $WWC is will wait for child window to be closed

Thanks in advance......... :):o

Share this post

Link to post
Share on other sites


Welcome to the forum! :)

Some examples:

$sTitle = InputBox("MyProgram", "Type a window title", "Untitled - Notepad")
If @error Then Exit

$hWnd = WinGetHandle($sTitle)
If @error Then Exit MsgBox(16, "Error", "No window matches the criteria")

$sClassWindow = WinGetClassList($hWnd)
$aString = StringSplit(StringTrimRight($sClassWindow, 1), @LF)
$iControlsNumber = $aString[0]

MsgBox(0, "Result", "Window handle: " & @LF & _
                    $hWnd & @LF & @LF & _
                    "Amount of controls" & @LF & _
                    $iControlsNumber & @LF & @LF & _
                    "Window controls:" & @LF & _

Also search on the forum:


Good luck :o

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this