Sn3akyP3t3 Posted February 1, 2013 Posted February 1, 2013 Breevy is a text expander tool that is a handy productivity tool. However, it can interfere with Send commands to some windows if it is enabled and has the Typo AutoCorrections library imported and the utility is enabled. I seek to determine programmatically what the status of Breevy is either Enabled or Disabled. Via the GUI the utility presents the status as "Enabled" or "Disabled". This was my script to test with: ;With Breevy running and minimized If WinExists('Breevy') Then Opt('WinDetectHiddenText', 1) $hBreevy = WinGetHandle('Breevy') MsgBox(0,"",WinGetText($ hBreevy)) EndIf Results: Breevy.exe Summary of AutoIt v3 Window Info tool: >>>> Window <<<< Title: Breevy (Portable Mode) Class: gdkWindowToplevel Position: -8, -8 Size: 1296, 1010 Style: 0x17CF0000 ExStyle: 0x00000110 Handle: 0x00000000001309DE >>>> Control <<<< Class: Instance: ClassnameNN: Name: Advanced (Class): ID: Text: Position: Size: ControlClick Coords: Style: ExStyle: Handle: >>>> Mouse <<<< Position: 592, 10 Cursor ID: 0 Color: 0xC7D5E3 >>>> StatusBar <<<< >>>> ToolsBar <<<< >>>> Visible Text <<<< Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe Breevy.exe >>>> Hidden Text <<<< Breevy.exe Any tips or suggestions will be appreciated. Also, is what I'm seeking to achieve feasible via viewing text of the window when minimized to the task bar in the tray?
Moderators Melba23 Posted February 2, 2013 Moderators Posted February 2, 2013 Sn3akyP3t3,minimized to the task bar in the trayDoes the traytip or traymenu text of the app change with its status? If so then we should be able to detect that when the app is minimized to the tray. 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
Sn3akyP3t3 Posted March 15, 2013 Author Posted March 15, 2013 Melba23, Yes, the status does change, but I wasn't sure how to go about reading tray icon text. Using your script from I experimented and found that the icon can be found and the enabled/disabled status can be parsed. However, is there a technique to read hidden tray icons or is the only means to do so available if the icons are visible in the tray?
Moderators Melba23 Posted March 15, 2013 Moderators Posted March 15, 2013 Sn3akyP3t3,Just action the button on the taskbar to show all the icons before actioning the one you want: expandcollapse popup#include <GuiToolBar.au3> Global $hSysTray_Handle HotKeySet("q", "_Show") HotKeySet("{ESC}", "_Exit") While 1 Sleep(10) WEnd Func _Show() $iSysTray_ButtonNumber = _Get_Systray_Index("") ; Put your traytip text here as before <<<<<<<<<<<<<<<<<<<<<< If @error Then MsgBox(16, "Error", "Icon not found in system tray") Exit EndIf ; Show hidden icons <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< $hTaskBarHandle = WinGetHandle("[Class:Shell_TrayWnd]", "") ControlClick($hTaskBarHandle, "", "[CLASS:Button; INSTANCE:1]") ; Action icon <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< _GUICtrlToolbar_ClickButton($hSysTray_Handle, $iSysTray_ButtonNumber, "right") EndFunc ;==>_Show Func _Get_Systray_Index($sText) ; 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 tooltip For $iSysTray_ButtonNumber = 0 To $iSysTray_ButCount - 1 If StringInStr(_GUICtrlToolbar_GetButtonText($hSysTray_Handle, $iSysTray_ButtonNumber), $sText) > 0 Then ExitLoop Next If $iSysTray_ButtonNumber = $iSysTray_ButCount Then Return SetError(1, 0, -1) ; Not found Else Return $iSysTray_ButtonNumber ; Found EndIf EndFunc ;==>Get_SysTray_Index Func _Exit() Exit EndFuncIt works fine on Vista - you might need to check the CLASS/INSTANCE values for the "Show" button on other OSes. 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
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