Jump to content

Can't get FindString / SelectString to work with combobox


mireazma
 Share

Recommended Posts

The application I is most probably made with MSVS. Here's how I reproduced a similar one:

  Screenshot_3.thumb.png.5a1b9144a6baff65281bbc842627f94b.png


Here's the AutoIt Window info:
edit.thumb.png.42d69ca653412ddac7383bc7a2c483b6.pngc60b6.thumb.png.ff956c6b3dec6897f7d4d443e971e011.png

 

5ns5de.thumb.png.0ea4ef5f49d640b4ef57a53b12c046e6.png

Here's the code I used, results are commented in the code:

Global $window = "AU3 sand"

WinActivate($window)
WinWaitActive($window)


Global $txt2 = ControlGetText($window, "", "[CLASSNN:Edit1]")

MsgBox(0, "", $txt2)

 ; refocused as advised in the help file
WinActivate($window)
WinWaitActive($window)



 ; edit  - yields 0
Global $grab1 = ControlCommand($window, "", "[CLASS:Edit; INSTANCE:1]", "FindString",'fast')
 ; edit  - yields 0
Global $grab2 = ControlCommand($window, "", "[ID:1001]", "FindString",'fast')
 ; combo  - yields 0
Global $grab3 = ControlCommand($window, "", "[CLASS:WindowsForms10.COMBOBOX.app.0.141b42a_r24_ad1; INSTANCE:1", "FindString",'fast')
 ; combo  - yields 0
Global $grab4 = ControlCommand($window, "", "[NAME:comboBox2]", "FindString",'fast')
 ; combo  - yields 0
Global $grab5 = ControlCommand($window, "", "[ID:198018]", "FindString",'fast')
 ; list  - yields 0
Global $grab6 = ControlCommand($window, "", "[CLASS:Progman; INSTANCE:1]", "FindString",'fast')
 ; the list doesn't have an ID so I can't use `ID`

MsgBox(0, "", $grab1 & $grab2 & $grab3 & $grab4 & $grab5 & $grab6) ; yields 000000

WinActivate($window)
WinWaitActive($window)

 ; does nothing
ControlCommand($window, "", "[CLASS:WindowsForms10.COMBOBOX.app.0.141b42a_r24_ad1; INSTANCE:1", "SelectString",'medium')
 ; does nothing
ControlCommand($window, "", "[CLASS:Progman; INSTANCE:1]", "SelectString",'medium')
 ; does nothing
ControlCommand($window, "", "[CLASS:Progman; INSTANCE:1]", "SelectString",'medium')

I've also checked this topic to no avail:
https://www.autoitscript.com/forum/topic/123094-select-value-from-dropdown/

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...