Algotek Posted April 11, 2013 Posted April 11, 2013 (edited) I'm using AutoitX 3.3.8.1 with vb.netJust trying to automate selecting a newvalue in a combobox which is in a dialog of an external application.I know the dlghwnd, the combohwnd, and also the ctrl id of the combo in the dialog.No problem.text of combo is empty according to AUtoIt window info toolThis tool reports also [CLASS:ComboBox; INSTANCE:4] or ComboBox4When the comboctrlid is not 0, the following works well.dim ai As New AutoItX3Lib.AutoItX3ai.AutoItSetOption("WinTitleMatchMode", 3)res = ai.ControlCommand("[HANDLE: "+dlghwnd.ToString()+"]", "", "[iD:" + comboctrlid.ToString() + "]", "SelectString", newvalue)res is "0", but the combo is changedHowever if the comboctrlid is 0, or if I want to try a different methodres = ai.ControlCommand("[HANDLE: "+dlghwnd.ToString()+"]", "", "ComboBox4", "SelectString", newvalue)res = ai.ControlCommand("[HANDLE: "+dlghwnd.ToString()+"]", "", "[CLASS:ComboBox; INSTANCE:4]", "SelectString", newvalue)are not working,res is "0", the combo is not changed.but this will workres = ai.ControlCommand(dialogtitle, "", "ComboBox4", "SelectString", newvalue)res = ai.ControlCommand(dialogtitle, "", "[CLASS:ComboBox; INSTANCE:4]", "SelectString", newvalue)res is "0", the combo is changed.It seems that the Advanced Windows Text options such as LAST, ACTIVE, HANDLE will not work in the first Title parameter when used with 3rd parameter CLASSNAMENN instead of CTRLIDIs this a bug, or a feature ?Or am I missing something ? Edited April 11, 2013 by Algotek
Algotek Posted April 11, 2013 Author Posted April 11, 2013 I finally found something that will work for me:res = ai.ControlCommand("[HANDLE: "+ctrlhwnd.ToString()+"]", "", "", "SelectString", newvalue)Documentation should be updated...
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