Kogan Posted November 2, 2017 Share Posted November 2, 2017 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 More sharing options...
funkey Posted November 2, 2017 Share Posted November 2, 2017 Without your code we are not able to see what is going wrong. Kogan 1 Programming today is a race between software engineers striving tobuild bigger and better idiot-proof programs, and the Universetrying to produce bigger and better idiots.So far, the Universe is winning. Link to comment Share on other sites More sharing options...
Kogan Posted November 2, 2017 Author Share Posted November 2, 2017 (edited) 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 November 14, 2017 by Kogan Inserted the code used Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now