Vadersapien Posted December 5, 2009 Share Posted December 5, 2009 Hi, I would like to know how to get the width of my application's taskbar button. Had a look at GetSystemMetrics but couldn't find anything interesting... Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor. Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 5, 2009 Share Posted December 5, 2009 Hi,I would like to know how to get the width of my application's taskbar button. Had a look at GetSystemMetrics but couldn't find anything interesting...The taskbar is just a toolbar, and those are just buttons on the toolbar. Use _GuiCtrlToolBar_GetButtonSize() on it. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Vadersapien Posted December 5, 2009 Author Share Posted December 5, 2009 I'm confused on how to use that function...is it something like _GuiCtrlToolBar_GetButtonSize('[CLASS:Shell_TrayWnd]') ? And if so, wouldn't that get it for all taskbar buttons, even though each can vary in size on Windows 7(think pinned items)? Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor. Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 5, 2009 Share Posted December 5, 2009 In XP, they are all the same size. I can't pry my son off Left4Dead long enough to try anything on the Win7 box. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Vadersapien Posted December 5, 2009 Author Share Posted December 5, 2009 (edited) In XP, they are all the same size. I can't pry my son off Left4Dead long enough to try anything on the Win7 box. Lol Also this code:Global $TaskbarButtonSize = _GuiCtrlToolBar_GetButtonSize('[CLASS:Shell_TrayWnd]') MsgBox(-1, 'Return Value', $TaskbarButtonSize)Gives a blank MsgBox Edited December 5, 2009 by Vadersapien Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor. Link to comment Share on other sites More sharing options...
whim Posted December 5, 2009 Share Posted December 5, 2009 Lol Also this code:Global $TaskbarButtonSize = _GuiCtrlToolBar_GetButtonSize('[CLASS:Shell_TrayWnd]') MsgBox(-1, 'Return Value', $TaskbarButtonSize)Gives a blank MsgBox -1 is not a valid MsgBox type AFAIK, try 0hth,whim Link to comment Share on other sites More sharing options...
PsaltyDS Posted December 5, 2009 Share Posted December 5, 2009 Also this code: Global $TaskbarButtonSize = _GuiCtrlToolBar_GetButtonSize('[CLASS:Shell_TrayWnd]') MsgBox(-1, 'Return Value', $TaskbarButtonSize)Gives a blank MsgBox Review that function in the help file. You didn't pass the handle to the toolbar control. You didn't even pass the class for the control, that's the window. Also, it returns an array. This works on XP, don't know what it does on Win7: #include <GuiToolbar.au3> Global $hWin = WinGetHandle("[CLASS:Shell_TrayWnd; INSTANCE:1]", "") Global $hTaskbar = ControlGetHandle($hWin, "", "[CLASS:ToolbarWindow32; INSTANCE:2]") Global $TaskbarButtonSize = _GUICtrlToolbar_GetButtonSize($hTaskbar) MsgBox(64, 'Return Value', "$TaskbarButtonSize[0] (Height) = " & $TaskbarButtonSize[0] & @CRLF & _ "$TaskbarButtonSize[1] (Width) = " & $TaskbarButtonSize[1]) Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
Vadersapien Posted December 6, 2009 Author Share Posted December 6, 2009 That code gives me "Height:38 Width:24", even though they're wider then they are higher(maybe it's just mixed up). Anyway even the width is far off 38 pixels. Try Pacfox, my Firefox theme.Try Power Eject, my windows gadget that allows you to eject most drives.Using AutoIt 3.3.4.0, Windows 7 Premium, Intel Core 2 Quad CPU @ 2.66ghz, 4gb RAM, Nvidia GeForce 9500GT Graphics Card & Samsung 22" Monitor. Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted December 6, 2009 Moderators Share Posted December 6, 2009 Vadersapien,Use the Au3Info tool to determine the correct title to use for the taskbar. For example, on my Vista system:[CLASS:ToolbarWindow32; INSTANCE:2] = the notification area - I get 18x18[CLASS:ToolbarWindow32; INSTANCE:4] = the main taskbar - I get 164 x 30M23 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...
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