Jump to content

Autoit - lost focus after child window pops up

Recommended Posts


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!

Share this post

Link to post
Share on other sites

Without your code we are not able to see what is going wrong.

  • Like 1

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe
trying to produce bigger and better idiots.
So far, the Universe is winning.

Share this post

Link to post
Share on other sites

Hi Funkey,
I am trying to automate PDF advanced search using autoit, below is the code am using which gets stuck after control command.

The script never exits.

#include <Constants.au3>
 #include <GuiMenu.au3>
 #include <WinAPI.au3>
#include <Array.au3>
#include <GuiComboBox.au3>

Func PdfOpen ()

Run("C:\Program Files (x86)\Adobe\Acrobat 2015\Acrobat\Acrobat.exe")

WinWaitActive('Search',"", 10)

 $hWnd = ControlGetHandle(WinGetHandle("Search"),"","[CLASS:ComboBox; INSTANCE:11]")
if ($hWnd) Then
 $RtArray = _GUICtrlComboBox_GetListArray($hWnd)

Local $computer="Bro"
$iPosition=_ArraySearch($RtArray,$computer, 0, 0, 0, 1, 1, $sColumn)

                ControlCommand("Search", "", "[CLASS:ComboBox; INSTANCE:11]", "SetCurrentSelection", $iPosition-1)



Edited by Kogan
Inserted the code used

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