Jump to content
Sign in to follow this  
Akshay07

Select an option when right clicking on a tray icon

Recommended Posts

Akshay07

Hello all,

I am having big troubles with a tray icon.

The tray icon related to this program allows the user to select several options when right clicking on it.

Let's say that this tray icon is giving the choice to select (when right clicking on it)

- setting 1

- setting 2

- setting 3

I want to make sure that setting 1 will be selected (meaning that I want to select it in my script).

I am not sure how to do that. I used au3info (and looked at the "summary" tab), then right clicked on the tray icon and moved from setting 1, 2 and 3 using arrows but au3info is always showing the same information. Only the color field is changing.

I could really use some help, I don't even know where to start from (I was hoping au3info will help).

Edited by Akshay07

Share this post


Link to post
Share on other sites
Melba23

Akshay07,

There is no shortcut to doing this. If the same option is always highlighted (highlit?) when you open the tray menu then you can send cursor keys to move around. Something like this from one of my scripts:

Sleep(500)
_GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right", True, 1, 0)
Sleep(500)
; Move around traymenu to firewall state menu
Send("{DOWN}{LEFT}")
Sleep(500)
Switch $sAction
    Case "Block"
        Send("{ENTER}")
    Case "Open"
        Send("{DOWN}{DOWN}")
        Sleep(500)
        Send("{ENTER}")
EndSwitch

Notice the Sleep commands. I have found by experience that it helps to pause a little when the menu needs to open a submenu or when you need to action something within it.

I hope this helps. :D

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Akshay07

Thanks to both of you.

Melba23, your solution is the best taking into account how the program is done.

I have a question about your script:

$hSysTray_Handle

How do i get the SysTray handle of an external program (not autoit related)?

From what I found in the help, I can see that I can get the tray handle of an autoit created tray object, but I can't find out how to find the tray handle of an object that is created by another program.

Share this post


Link to post
Share on other sites
Melba23

Akshay07,

You really should try the "Search" button sometimes.... :huggles:

Take a look here. You might need to keep reading the rest of the topic as well. :D

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites
Akshay07

Sorry, I am used to search in the autoit help, but I have to admit that I don't really search in the forum itself :D

Will try to improve this part.

Thanks for your help!

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  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.