-1

I am trying to click on an item from combobox control from parent window. once I click, a new child window pops up, then I need to click on OK button in the child window.

Problem here is, when the child window pops up, the autoit script loses its focus. I have used WinGetTitle, WinWaitActive, WinActivate to get control of child window, but none are working.

Any help in this is highly appreciated. Thanks!

Ko Nayaki
  • 74
  • 10

2 Answers2

0

In order for AutoIt to 'see' child windows, you need to set Opt

Opt("WinSearchChildren", 1) ;0=no, 1=search children also
Milos
  • 2,927
  • 1
  • 15
  • 27
0

#include <GUIConstantsEx.au3>
$hGUI = GUICreate("Test", 500, 500)
$cButton = GUICtrlCreateButton("Child", 10, 10, 80, 30)
GUISetState()
While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $cButton
            _Child()
    EndSwitch
WEnd
Func _Child()
    Global Const $hChild = GUICreate("Child", 200, 200)
    GUISetState()
    While 1
        Switch GUIGetMsg()
            Case $GUI_EVENT_CLOSE
                GUIDelete($hChild)
                Return
        EndSwitch
    WEnd
EndFunc
N.J One
  • 3
  • 4