CaptainBeardsEyesBeard Posted March 16, 2022 Share Posted March 16, 2022 Previously I changed a combo box (for another program) Local $hWnd3= WinWait("[CLASS:ProMainWin]", "", 10) $hComBo1=ControlGetHandle($hWnd3, "", "ComboBox4") Sleep(1000) _GUICtrlComboBox_SetCurSel($hComBo1, 35) However I googled autoit combo boxes and came across about Windows Forms (which I assume is what I'm dealing with given the control class) and tried it this way which was the answer after googling. ; --------------------------------------------------------------------------- ;Action: Change Combo box to "Elite Matter Number" $hComBo1=ControlGetHandle($hWnd, '', 'WindowsForms10.Window.8.app.0.338574f_r42_ad112') if @error then Msgbox(16, "Error", "Cannot ControlGetHandle the dropdown combox to select Elite Matter Number") endif Sleep(1000) ;_GUICtrlComboBox_SetCurSel($hComBo1, 6) _GUICtrlComboBox_SelectString($hComBo1, "Matter Management - Elite Matter Number (File Cover) (FCO06)") if @error then MsgBox(16, "Error", "Cannot select Combo box") EndIf ; --------------------------------------------------------------------------- It quits the program though and outputs this at console $hComBo1=ControlGetHandle($hWnd, '', 'WindowsForms10.Window.8.app.0.338574f_r42_ad112') $hComBo1=ControlGetHandle(^ ERROR >Exit code: 1 I wonder why it doesn't trigger the if @error statement and just ends? Link to comment Share on other sites More sharing options...
ad777 Posted March 16, 2022 Share Posted March 16, 2022 @CaptainBeardsEyesBeard first i dont see $hWnd var ,but this: Local $hWnd3= WinWait("[CLASS:ProMainWin]", "", 10) should be: Local $hWnd= WinWait("[CLASS:ProMainWin]", "", 10) iam ِAutoit programmer. best thing in life is to use your Brain to Achieve everything you want. Link to comment Share on other sites More sharing options...
Earthshine Posted March 17, 2022 Share Posted March 17, 2022 (edited) Trying to control a windows 10 form isn’t going to work in native auto IT it’s not a win32 form nor are the controls win32 you can use UIAutomation Edited March 17, 2022 by Earthshine My resources are limited. You must ask the right questions 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