hhzz Posted June 20, 2008 Share Posted June 20, 2008 There are some programs that start-up in the Windows System Tray (AKA Windows Notification Area) (or has the option to do so). I could not find any way to simulate double-click on the tray icon to perform the default action; or right-click on the tray icon to bring up its menu. Does anyone know how to do this? I have tried: 1) Getting to it from Task Manager: You can see the program running as active "Process" in the Task Manager, but not as "Application", so there is no way to switch to it from there. 2) Using AutoIt Window Info program to capture information of the tray area. I was able to target the tray area, getting this information, but what can I do with it? >>>> Window <<<< Title: Class: Shell_TrayWnd Position: 0, 960 Size: 1280, 64 Style: 0x96000000 ExStyle: 0x00000088 Handle: 0x00010070 Thanks in advance for your help. Link to comment Share on other sites More sharing options...
BrettF Posted June 20, 2008 Share Posted June 20, 2008 Maybe the window is hidden? Try see if you can set the state of the window to being shown. Vist my blog!UDFs: Opens The Default Mail Client | _LoginBox | Convert Reg to AU3 | BASS.au3 (BASS.dll) (Includes various BASS Libraries) | MultiLang.au3 (Multi-Language GUIs!)Example Scripts: Computer Info Telnet Server | "Secure" HTTP Server (Based on Manadar's Server)Software: AAMP- Advanced AutoIt Media Player | WorldCam | AYTU - Youtube Uploader Tutorials: Learning to Script with AutoIt V3Projects (Hardware + AutoIt): ArduinoUseful Links: AutoIt 1-2-3 | The AutoIt Downloads Section: | SciTE4AutoIt3 Full Version! Link to comment Share on other sites More sharing options...
hhzz Posted June 20, 2008 Author Share Posted June 20, 2008 Hi Bert,Maybe the window is hidden? Try see if you can set the state of the window to being shown. Thanks for your reply. However it does not seem that the window is hidden. Actually it does not even exists. I checked this with WinGetState and WinExists functions.I also tried opening using "Run" with maximize option, but still no avail. Link to comment Share on other sites More sharing options...
hhzz Posted June 21, 2008 Author Share Posted June 21, 2008 Wow, I actually found an partial solution at: http://www.autoitscript.com/forum/index.php?showtopic=74129... I don't know why I couldn't find it earlier. Anyway, the full solution to this is now:#Include <GuiToolBar.au3> _ClickTrayButton("name of the button here") Func _ClickTrayButton($insButtonName) Local $iMode = Opt("WinTitleMatchMode", 4) Local $hControl = ControlGetHandle("[CLASS:Shell_TrayWnd]", "", "[CLASSNN:ToolbarWindow321]") Local $iButtons = _GUICtrlToolbar_ButtonCount($hControl) For $i = 0 To $iButtons Local $iCmd = _GUICtrlToolbar_IndexToCommand($hControl, $i) Local $sButtonName = _GUICtrlToolbar_GetButtonText($hControl, $iCmd) ; msgbox(0, "button", $sButtonName) If (StringRegExp($sButtonName, $insButtonName, 0)) Then ;msgbox(0, "button", "Found " & $insButtonName & " at " & $iCmd & ". Now click") _GUICtrlToolbar_ClickButton($hControl, $iCmd, "left", False, 2, 0) ExitLoop EndIf Next Opt("WinTitleMatchMode", $iMode) EndFunc 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