Jump to content

Click on an element from Visible Text list possible?


Am3oo
 Share

Recommended Posts

Hi,

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","");

Then:

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

Which doesn't do anything, unfortunately for me.

Edited by Am3oo
Link to comment
Share on other sites

  • Moderators

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)
GUISetState(@SW_SHOW)

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...