mumdigau Posted March 31, 2008 Share Posted March 31, 2008 Hi, When you rightclick the taskbar, a context menu opens. Pointing to the first entry opens a submenu which shows all bars implemented and their status (activated or deactivated). WinActivate("classname=Shell_TrayWnd") Send("{SHIFTDOWN}{F10}{SHIFTUP}") Send("{DOWN}{RIGHT}") brings up the submenu. But how do I get the bars' names and their status? (I want to check/uncheck certain bars depending on the hardware profile Windows has been started with.) Many thanks for any help. mumdigau Link to comment Share on other sites More sharing options...
mumdigau Posted March 31, 2008 Author Share Posted March 31, 2008 (edited) I tried a bit on my own. That is where I am at the moment: expandcollapse popup#include <GuiMenu.au3> ;;; Opt("TrayIconDebug", 1) Opt("WinTitleMatchMode", 2) Opt("MustDeclareVars", 1) ;;; Dim $hTDSL Dim $iBars Dim $hWin Dim $iMenuItems Dim $hMenu Dim $iBarsItems Dim $hTDSL Dim $sItemText Dim $iStatusBar Dim $iStatusBarStatus Dim $i ;;; Dim Const $menu_text = "Symbolleisten" Dim Const $submenu_text = "T-DSL SpeedManager" ;;; $hWin = WinGetHandle("[CLASS:Shell_TrayWnd]") $hMenu = _GUICtrlMenu_GetMenu($hWin) $iMenuItems = _GUICtrlMenu_GetItemCount($hMenu) $iBars = -1 For $i = 0 To $iMenuItems - 1 $sItemText = _GUICtrlMenu_GetItemText($hMenu, $i, True) If StringInStr($sItemText, $menu_text) Then $iBars = $i EndIf Next $hTDSL = _GUICtrlMenu_GetItemSubMenu($hMenu, $iBars) $iBarsItems = _GUICtrlMenu_GetItemCount($hTDSL) For $i = 0 To $iBarsItems - 1 $sItemText = _GUICtrlMenu_GetItemText($hTDSL, $i, True) If StringInStr($sItemText, $submenu_text) Then $iStatusBar = $i EndIf Next $iStatusBarStatus = _GUICtrlMenu_GetItemState($hTDSL, $iStatusBar, True) The handle to the taskbar seems to work, but I can't get the handle to the menu. Return Code is always 0 (i. e. failure). Missing/wrong #include? Any other idea? Thanks mumdigau Edited March 31, 2008 by mumdigau Link to comment Share on other sites More sharing options...
mumdigau Posted April 1, 2008 Author Share Posted April 1, 2008 Hi, No help here? Can't believe that! Just want a hint why the GUI functions don't work in the code above. Come on. Thanks in advance. mumdigau 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