Jump to content
Sign in to follow this  

Click on an element from Visible Text list possible?

Recommended Posts



Considering a control with a list of clickable items present only as Visible Text Strings, can you click one of those elements?

Window Info cannot select anything from that list, just the container.

What I have now is:

ControlClick($handler, "", "[CLASS:TRzComboBox; INSTANCE:1]");

Which expands the combo box. I can also expand it with:

ControlCommand($handler, "", "[CLASS:TRzComboBox; INSTANCE:1]", "ShowDropDown","");


ControlCommand($handler, "", "[CLASS:TRzComboBox; INSTANCE:1]", "SelectString", "SomeItem");

Which doesn't do anything, unfortunately for me.

Edited by Am3oo

Share this post

Link to post
Share on other sites

Hi, Am3oo, is this a GUI that you have created, or an external application? IF it is your GUI, you can use GUICtrlRead to get the value that is clicked. Something like this, for example:

#include <GUIConstantsEX.au3>
#include <WindowsConstants.au3>

GUICreate("Test Combo Box", 200, 160)
$combo = GUICtrlCreateCombo("List", 10, 10, 180, 40)
GUICtrlSetData(-1, "Item1|Item2|Item3", "List")
$button = GUICtrlCreateButton("Which one did I pick?", 10, 60, 120, 50)

While 1
Local $msg = GUIGetMsg()
Case $msg = $GUI_EVENT_CLOSE
Case $msg = $button
MsgBox(0, "", "You picked " & GUICtrlRead($combo))
Edited by JLogan3o13
  • Like 1

√-1 2^3 ∑ π, and it was delicious!

Share this post

Link to post
Share on other sites

Hi, it is an external application for which I might be able to access the source code, if that would be of any help. Also, I'm trying to automate testing on the app, not see which element was clicked.

I was thinking that if I can get the list of visible text from the combo box, I could click on an x/y spot after computing the element's position, knowing the Font size, so the third element would be x:0, y=(font_size)*2+font_size/2 (so that it will be in the middle of the text).

SO not wasting any more time, is it possible to click on a spot relative to a certain container/control?

Edited by Am3oo

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