Sign in to follow this  
Followers 0
Algotek

Bug when using AutoitX ControlCommand with HANDLE and CLASSNAMENN

2 posts in this topic

#1 ·  Posted (edited)

I'm using AutoitX 3.3.8.1 with vb.net

Just 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 tool

This tool reports also [CLASS:ComboBox; INSTANCE:4] or ComboBox4

When the comboctrlid is not 0, the following works well.

dim ai As New AutoItX3Lib.AutoItX3

ai.AutoItSetOption("WinTitleMatchMode", 3)

res = ai.ControlCommand("[HANDLE: "+dlghwnd.ToString()+"]", "", "[iD:" + comboctrlid.ToString() + "]", "SelectString", newvalue)

res is "0", but the combo is changed

However if the comboctrlid is 0, or if I want to try a different method

res = 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 work

res = 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 CTRLID

Is this a bug, or a feature ?

Or am I missing something ?

Edited by Algotek

Share this post


Link to post
Share on other sites



I finally found something that will work for me:

res = ai.ControlCommand("[HANDLE: "+ctrlhwnd.ToString()+"]", "", "", "SelectString", newvalue)

Documentation should be updated...

Share this post


Link to post
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
Sign in to follow this  
Followers 0