Sign in to follow this  
Followers 0
chickenselects

Selecting dropdown menu option problems

11 posts in this topic

Hello all,

First of I just want to say thanks to the developers for such a get program. I find it very usefull in software automation configuration.

I use a peice of software that has a drop down menu with three options (Generic, SWDL, and Central Config). This is proprietary and I have no control over the development of the software nor can I share it. I have an automated script of controlclicks to set configurations but I seem to be having trouble selecting from dropdown menus. I have been using Window Info but can't seem to find a unique value that I can use to my advantage in controlclicking it.

Here is the menu:

http://img119.imageshack.us/img119/8844/menuvh5.jpg

Here is the Window Info:

>>>> Window <<<<
Title:  
Class:  #32769
Position:   0, 0
Size:   1280, 1024
Style:  0x96000000
ExStyle:    0x00000000

>>>> Control <<<<
Class:  ComboLBox
Instance:   1
ID: 1000
Text:   
Position:   913, 160
Size:   96, 41
ControlClick Coords:    49, 17
Style:  0x54808041
ExStyle:    0x00000088

There are multiple ComboLBox classes on the page and they are all instance 1. I just need to select the option, not minipulate it in anyway.

Does anyone have any ideas besides a mouseclick? I perfer not to use it as multiple people use this script on multiple resolutions.

Thanks for your time.

-Mike

Share this post


Link to post
Share on other sites



instead of a regular mouse click, did you try clicking it like it was a button using the control ID? like this? ControlClick($hWnd, "", 1000) and then Send("{down}") time X.... I dunno, I am at work so I don't have time to test that theory.

Share this post


Link to post
Share on other sites

That works for everything except these drop down menus. The problem is the class, ID, and instance are not unique so that wont work.

Thanks for the reply though :rolleyes:

Share this post


Link to post
Share on other sites

why not {tab} to it and then {down} if you don't want to use a mouseclick. Also on a side note, run the application in some other res, you should be able to come up with a formula based on @deskwidth and @deskheight that will be able to always know where the drop down is.

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

didn't realize you can have it move down, i just started using this program 2 days ago. Thanks for the clue! Whats the name of the function to just 'press the down arrow'?

Thanks.

Edited by chickenselects

Share this post


Link to post
Share on other sites

anyone? im pretty much sitting here reading the help file. This is the last line of code to finish this script. bleh.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Send("{down}") is how you press the down arrow

So you could use:

Send("{tab}") until you are at the drop down menu, THEN

Send("{down}") until you are at the right option

to select that option you are now on, you could press tab again or ( i think ) press spacebar

let me know if this works.

Will you post the script you have so far?

Edited by danwilli

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Thank you very much. Problem solved.

EDITx3: Yes i can post my script but no one can actualy run it without the software. I'm not allowed to post the software under company policy otherwise i would. If you want ill still post the script. Thanks again.

Edited by chickenselects

Share this post


Link to post
Share on other sites

always a good idea to post the script, even if it is ugly LOL

I learn something everytime I post a script, cause there are some smart MFs here

Share this post


Link to post
Share on other sites

its mostly controlclicks but i did write a select and an input function someone might want but i doubt it. ill post in 5

Share this post


Link to post
Share on other sites

#11 ·  Posted (edited)

Here is all thats worth posting.

Heres a Select statement inside a while loop. There were 6 seperate fields to fill in two Hex digits. (aka all the instances and the need for the place variable)

;write mem config to Ford DET
$counter=1
$bLoop=1
$place=1
While $bLoop=1
    $insertConfig = StringMid($DE00Config,$place,2)
    Select
        Case $counter=1
            ControlClick("Diagnostic Engineering Tool v2.5.0","","[CLASS:WindowsForms10.EDIT.app3; INSTANCE:19;]","left",2)
            ControlSend("Diagnostic Engineering Tool v2.5.0","","[CLASS:WindowsForms10.EDIT.app3; INSTANCE:19;]",$insertConfig)
        Case $counter=2
            ControlClick("Diagnostic Engineering Tool v2.5.0","","[CLASS:WindowsForms10.EDIT.app3; INSTANCE:18;]","left",2)
            ControlSend("Diagnostic Engineering Tool v2.5.0","","[CLASS:WindowsForms10.EDIT.app3; INSTANCE:18;]",$insertConfig)
        Case $counter=3
            ControlClick("Diagnostic Engineering Tool v2.5.0","","[CLASS:WindowsForms10.EDIT.app3; INSTANCE:17;]","left",2)
            ControlSend("Diagnostic Engineering Tool v2.5.0","","[CLASS:WindowsForms10.EDIT.app3; INSTANCE:17;]",$insertConfig)         
        Case $counter=4
            ControlClick("Diagnostic Engineering Tool v2.5.0","","[CLASS:WindowsForms10.EDIT.app3; INSTANCE:16;]","left",2)
            ControlSend("Diagnostic Engineering Tool v2.5.0","","[CLASS:WindowsForms10.EDIT.app3; INSTANCE:16;]",$insertConfig)
        Case $counter=5
            ControlClick("Diagnostic Engineering Tool v2.5.0","","[CLASS:WindowsForms10.EDIT.app3; INSTANCE:15;]","left",2)
            ControlSend("Diagnostic Engineering Tool v2.5.0","","[CLASS:WindowsForms10.EDIT.app3; INSTANCE:15;]",$insertConfig)
        Case $counter=6
            ControlClick("Diagnostic Engineering Tool v2.5.0","","[CLASS:WindowsForms10.EDIT.app3; INSTANCE:14;]","left",2)
            ControlSend("Diagnostic Engineering Tool v2.5.0","","[CLASS:WindowsForms10.EDIT.app3; INSTANCE:14;]",$insertConfig)
        Case Else
            $bLoop=0
    EndSelect
    $counter = $counter+1
    $place = $place +2
WEnd

Heres a function to read in a Hex number 12 digits long. It has error checking to confirm the length and that it is a valid hex number. I didn't know how to make it so that if the user presses cancle on the input that it actualy fills in MemConfig with 12 zeros. Could be a nice feature but its not important.

$bLoop = 1
$length=0
While $bLoop = 1
    $errorCheck = 1
    $MemConfig = InputBox("Memory Configuration","Please enter the 12 digit Hexidecimal configuration number with no spaces or dashes. (Please note the cancle button does not work at this prompt.)")
    $errorCheck = StringIsXDigit($MemConfig)
    $length = StringLen($MemConfig)
    
    If $length = 12 And $errorCheck = 1 Then
        $answer = MsgBox(4,"Memory Configuration","Is this Memory configuration correct?: " & $MemConfig)
        If $answer = 6 Then
            $bLoop = 0
        EndIf
    EndIf
WEnd
Edited by chickenselects

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