kd6hq

Selecting from a pull down menu.

2 posts in this topic

#1 ·  Posted (edited)

I've looked thru the help files and cannot find one on how to automatically open a pull down menu and make a selection form the menu.  I can find lots on how to see what option is selected but none on how to select an item.

 

I have a program that I use that is not very good at retaining the com port used from one usage to the next time I use it.  So I would l like to open the pull down menu and select

the same comport each time I use it.  I've been trying to use the controlclick command to do this but so far have been unsuccessful. 

 

There are probably better ways but I don't know them so any help would be appreciated.

thank you

 ;

;LP-100 Wattmeter Com port selection

            FileChangeDir ( "C:\Program Files (x86)\LP-100-VCP" )

            Run ("C:\Program Files (x86)\LP-100-VCP\LP-100.exe")

            Sleep (1000)

            WinActivate ( "LP-100 Virtual Control Panel" )

            Sleep (1000)

;  Move and expand window

            WinMove ( "LP-100 Virtual Control Panel","", 1513, 481, 397, 319 )

;  Open pull down menu

;  This command will highlight the ID12 area but does not open the pull down menu.

    ControlClick ( "LP-100 Virtual Control Panel","","[ID:12]" )

    ControlClick ( "LP-100 Virtual Control Panel","", "[CLASS:ThunderRT6FormDC; TEXT:Com04; INSTNCE:1]", "left", 1 )

;

;  The mouse clicks will work however the second click is unrealizable because it is possible to choose the incorrect com port.

;  MouseClick ("left", 1576, 750, 1)

;  MouseClick ("left", 1555, 800, 1)

;

;  Resize window back to normal.

            WinMove ( "LP-100 Virtual Control Panel","", 1513, 481, 397, 172 )

Wattmeter.JPG

Edited by kd6hq

Share this post


Link to post
Share on other sites



 

    Resolved

;        LP-100 Wattmeter Com port selecton
    FileChangeDir ( "C:\Program Files (x86)\LP-100-VCP" )
    Run ("C:\Program Files (x86)\LP-100-VCP\LP-100.exe")
    Sleep (1000)
    WinActivate ( "LP-100 Virtual Control Panel" )
 Sleep (1000)
;        Move and expand window
    WinMove ( "LP-100 Virtual Control Panel","", 1513, 481, 397, 319 )
    Send("{TAB 12}")
    Sleep (300)
    Send("{HOME}")
    Send("{DOWN 2}")
    Sleep (5000)
;       Resize window back to normal.
   WinMove ( "LP-100 Virtual Control Panel","", 1513, 481, 397, 172 )

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