Akshay07 Posted January 19, 2010 Posted January 19, 2010 (edited) 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 January 19, 2010 by Akshay07
Moderators Melba23 Posted January 19, 2010 Moderators Posted January 19, 2010 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}") EndSwitchNotice 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. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Mison Posted January 20, 2010 Posted January 20, 2010 (edited) Set item state to checked, then disable it: TrayItemSetState($set1,$TRAY_CHECKED) TrayItemSetState($set1,$TRAY_DISABLE) or TrayItemSetState($set1,BitOR($TRAY_CHECKED,$TRAY_DISABLE)) Edited January 20, 2010 by Mison Hi ;)
Akshay07 Posted January 20, 2010 Author Posted January 20, 2010 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.
Moderators Melba23 Posted January 20, 2010 Moderators Posted January 20, 2010 Akshay07,You really should try the "Search" button sometimes.... Take a look here. You might need to keep reading the rest of the topic as well. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
Akshay07 Posted January 20, 2010 Author Posted January 20, 2010 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 Will try to improve this part. Thanks for your help!
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now