I have a UI application running as a Windows service, and I want to control that using AutoIt. I am able to get the handle of UI window and make it active by using WinGetHandle & WinActivate commands.But I am not able to control a ComboBox and Button. I am using the below script to do the intended task:
Local $hWnd1 = WinGetHandle ("UI Window", "") ;to get the handle of the UI
WinActivate( $hWnd1 ) ;to make it active
Sleep(2000)
ControlCommand($hWnd1, "", "ComboBox1", "ShowDropDown", "") ;to show the dropdown of Combo box
Sleep(3000)
ControlCommand($hWnd1, "", "ComboBox1", "SelectString", 'CollegeName') ;to select the string from dropdown list
Sleep(2000)
ControlCommand($hWnd1, "", "ComboBox1", "HideDropDown", "") ;to hide the dropdown of Combo box
Sleep(1000)
ControlClick($hWnd1, "", "[CLASS:Button; TEXT:Submit; INSTANCE:1]") ;to click on 'Submit' button
Sleep(2000)
This code is just making the window active and exiting out of the program after sometime doing nothing else. Is this problem occuring because it is running as windows service? If so, how can I send commands to my UI controls? Please help me out soon. PS: AutoIt Window Info is able to recognize each and every controls of UI (including ComboBox & Button). I don't want to run my script as a windows service.
ControlClick ( "title", "text", controlID [, button = "left" [, clicks = 1 [, x [, y]]]] )
– Mr. Hargrove