Shoby Posted May 12, 2015 Share Posted May 12, 2015 Hello Everyone,I am beginner in using this new scripting language.. SO, I need your help in figuring out this issue that i face while trying to right click the icon. I have also tried the code which is posted in the forum. But, it gives me button number is always 0. So please help me on this, I am stuck in the middle of the execution.I am able to get the handle of the tray but couldn't click the application which i want. Plz need your inputs.. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted May 12, 2015 Moderators Share Posted May 12, 2015 Shoby,Welcome to the AutoIt forum.But please pay attention to where you post - the "Dev Chat" section where you started this thread is not for general support questions. I have moved it for you, but would ask you to be more careful in future.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 Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 12, 2015 Moderators Share Posted May 12, 2015 Can you please post the code you're using, rather than making us guess "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
Shoby Posted May 12, 2015 Author Share Posted May 12, 2015 Shoby,Welcome to the AutoIt forum.But please pay attention to where you post - the "Dev Chat" section where you started this thread is not for general support questions. I have moved it for you, but would ask you to be more careful in future.M23Oh Sorry Melba..Will correct it in future.. Link to comment Share on other sites More sharing options...
Shoby Posted May 12, 2015 Author Share Posted May 12, 2015 expandcollapse popupThis is the code I got from the forum... Global $hSysTray_Handle, $iSystray_ButtonNumber Global $sToolTipTitle = "Link2DMSWindows " $iSystray_ButtonNumber = Get_Systray_Index($sToolTipTitle) If $iSystray_ButtonNumber = 0 Then MsgBox(16, "Error", "Icon not found in system tray") Exit Else Sleep(500) MsgBox(0,"Button Number",$iSystray_ButtonNumber) MsgBox(0,"Button Text",$sToolTipTitle) _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSystray_ButtonNumber, "right") Send("z") EndIf Exit ;............ Func Get_Systray_Index($sToolTipTitle) ; Find systray handle $hSysTray_Handle = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[Class:ToolbarWindow32;Instance:1]') If @error Then MsgBox(16, "Error", "System tray not found") Exit EndIf ; Get systray item count Local $iSystray_ButCount = _GUICtrlToolbar_ButtonCount($hSysTray_Handle) If $iSystray_ButCount = 0 Then MsgBox(16, "Error", "No items found in system tray") Exit EndIf ; Look for wanted tooltip For $iSystray_ButtonNumber = 0 To $iSystray_ButCount - 1 If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSystray_ButtonNumber), $sToolTipTitle) = 1 Then ExitLoop Next If $iSystray_ButtonNumber = $iSystray_ButCount Then Return 0 ; Not found Else Return $iSystray_ButtonNumber ; Found EndIf EndFuncI can only able to click the tray handle..after that I couldnt get the index of the icon as well as right clicking the icon..Please help me out in this..Thanks in advance.. Link to comment Share on other sites More sharing options...
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