CodyBarrett Posted March 2, 2010 Share Posted March 2, 2010 (edited) I was wondering how to get all the registered taskbar buttons that appear between the startbutton and the tray. $hWnd_Tray_Toolbar = ControlGetHandle ($hWnd_Tray,'','[CLASS:ToolbarWindow32; INSTANCE:2]') $temp = _GUICtrlToolbar_ButtonCount($hWnd_Tray_Toolbar) Dim $Text[$temp] For $1 = 0 To UBound ($Text) - 1 $Text[$1] = _GUICtrlToolbar_GetButtonText($hWnd_Tray_Toolbar, _GUICtrlToolbar_IndexToCommand($hWnd_Tray_Toolbar,$1)) Next (this isn't a working example i know... but the rest of the code isn't relative.. and choppy i'll organize it when i get this part working.) this brings up buttons but some of them aren't visible... (ex) -wExplorer & G:\Scripts\Startbar -Safari & Facebook | Home -SciTE & G:\Scripts\Startbar\Startbar.au3 ect.... they bring up more than the actual visible buttons. i was wondering, if there was a certain way to get the registered buttons on the Bar and get the text of them? Edited March 2, 2010 by CodyBarrett [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
BrettF Posted March 2, 2010 Share Posted March 2, 2010 Windows 7 has a Taskbar API. Whether that is helpful or not, I don't actually know. http://msdn.microsoft.com/en-us/magazine/dd942846.aspx Cheers, Brett 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...
Moderators Melba23 Posted March 2, 2010 Moderators Share Posted March 2, 2010 CodyBarrett,Check whether the button has the $TBSTATE_HIDDEN state. The following only lists the visible buttons on my system: #include <GuiToolBar.au3> $hWnd_Tray_Toolbar = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[CLASS:ToolbarWindow32; INSTANCE:4]') $iCount = _GUICtrlToolbar_ButtonCount($hWnd_Tray_Toolbar) For $i = 1 To $iCount $iCmdID = _GUICtrlToolbar_IndexToCommand($hWnd_Tray_Toolbar, $i) $iState = _GUICtrlToolbar_GetButtonState($hWnd_Tray_Toolbar, $iCmdID) If BitAnd($iState, $TBSTATE_HIDDEN) <> $TBSTATE_HIDDEN Then $sText = _GUICtrlToolbar_GetButtonText($hWnd_Tray_Toolbar, $iCmdID) ConsoleWrite($sText & @CRLF) EndIf NextYou may need to change the INSTANCE value to get the TaskBar handle - I am running Vista and I know that value varies between OSs. 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...
CodyBarrett Posted March 2, 2010 Author Share Posted March 2, 2010 CodyBarrett, Check whether the button has the $TBSTATE_HIDDEN state. The following only lists the visible buttons on my system: #include <GuiToolBar.au3> $hWnd_Tray_Toolbar = ControlGetHandle('[Class:Shell_TrayWnd]', '', '[CLASS:ToolbarWindow32; INSTANCE:4]') $iCount = _GUICtrlToolbar_ButtonCount($hWnd_Tray_Toolbar) For $i = 1 To $iCount $iCmdID = _GUICtrlToolbar_IndexToCommand($hWnd_Tray_Toolbar, $i) $iState = _GUICtrlToolbar_GetButtonState($hWnd_Tray_Toolbar, $iCmdID) If BitAnd($iState, $TBSTATE_HIDDEN) <> $TBSTATE_HIDDEN Then $sText = _GUICtrlToolbar_GetButtonText($hWnd_Tray_Toolbar, $iCmdID) ConsoleWrite($sText & @CRLF) EndIf Next You may need to change the INSTANCE value to get the TaskBar handle - I am running Vista and I know that value varies between OSs. M23 wow. i didn't even think of getting the State of the tool bar. thank you so much! Ps. I'm only using it on XP for now. [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] 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