To get a control handle for another GUI, you need to use the AutoIt Window Info Tool to identify this control. To get the class name of the control, go to the "Management" tab and find the value for "ClassnameNN". Now you can use this value, as in the example below.
Of course, you need to replace the "Button1"information obtained from the AutoIt Info Tool and change the window titles accordingly.
Global $hCtrl = 0, $Waiting = True
; your GUI loop
While (1)
If $Waiting And WinExists("Title of OtherApp.exe") Then
$hCtrl = ControlGetHandle("Title of OtherApp.exe", "", "Button1")
If $hCtrl Then
; we got the handle, so the button is there
; now do whatever you need to do
GUICtrlCreateLabel("Button is there!", 10, 10)
$Waiting = False
EndIf
EndIf
$iMsg = GUIGetMsg()
Switch $iMsg
Case $GUI_EVENT_CLOSE
ExitLoop
EndSwitch
WEnd
source
share