Jump to content

Autoit - lost focus after child window pops up


Kogan
 Share

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!

Link to comment
Share on other sites

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

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.

Link to comment
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>

PdfOpen()
Func PdfOpen ()


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

Send("^+{F}")
WinWaitActive('Search',"", 10)
Sleep(1000)

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

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

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

Sleep(200)
EndFunc


 

Edited by Kogan
Inserted the code used
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...