Search the Community
Showing results for tags 'windows system tray click'.
-
Hi All, Objective: Need to find a Application named "True Color Finder" running in the system tray of Win XP-32 bit and clicking left click , so that context menu opens up. Script used: #Include <GuiToolBar.au3> Opt("WinTitleMatchMode", 2) Global $hSysTray_Handle, $iSysTray_ButtonNumber Global $sToolTipTitle = "True Color Finder" $iSysTray_ButtonNumber = Get_SysTray_Index($sToolTipTitle) If $iSysTray_ButtonNumber = 0 Then MsgBox(16, "Error", "Is True Color Finder Running?") Exit Else Sleep(500) _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSysTray_ButtonNumber, "right") Sleep(2000) ;_GUICtrlToolbar_ClickIndex($hSysTray_Handle,2) Send("{UP}") Send("{UP}") ;Sleep(2000) Send("{ENTER}") ;_GUICtrlToolbar_ClickIndex($hSysTray_Handle,2, "left", True) Sleep(1000) ;~ $ret = _GUICtrlToolbar_GetButtonText($hSysTray_Handle,"#32768") ;~ msgbox(0,"",$ret) EndIf 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 EndFunc Problem Statement: The script above works only in few monitors, for other monitors it does not work. Anybody can please provide me help regarding it, i believe that there are some settings changes on the monitor which needs to be done. Can any body guide me regarding the setting changes. Resolution of monitor where the script runs: 1280 x 768. Resolution of monitor where the script does not run: 1920 x 1080. Thank you all of you.