Jump to content

Changing Quick Launch toolbar


Recommended Posts

  • 3 years later...

Part of the window rectangle is the size. Just keep the location the same and change the width or height.

So i tried a bit but this seems to work only partially. This kinda shrinks / extends amount of icons visible however the Quick Launch size stays the same.

#include <WinAPI.au3>

_ResizeQuickLaunchBar()

Func _ResizeQuickLaunchBar($fShow = True, $iIndex = 1)
    Local $hTaskBar, $hRebar, $hToolBar
    $hTaskBar = _WinAPI_FindWindow("Shell_TrayWnd", "")
    $hRebar = ControlGetHandle($hTaskBar, "", "ReBarWindow321")
    $hToolBar = ControlGetHandle($hRebar, "", "ToolbarWindow32" & $iIndex)
    If $hToolBar <> 0x00000000 Then
        If $fShow Then
        ;    _WinAPI_SetWindowPos($hTaskBar, "", 116, -1, 300, 60, $SWP_NOZORDER )
            _WinAPI_SetWindowPos($hToolBar, "", 5, 2, 300, 60 , $SWP_NOZORDER  )
           ;_WinAPI_ShowWindow($hToolBar, $SW_SHOW)
        Else
           ; _WinAPI_ShowWindow($hToolBar, $SW_HIDE)
        EndIf
    EndIf
EndFunc   ;==>_ShowProgramsShowingInTaskBar
Edited by MadBoy

My little company: Evotec (PL version: Evotec)

Link to comment
Share on other sites

To resize, use _GUICtrlRebar_SetBandLength() and other funcs from GuiRebar UDF. To work with it's buttons, use GuiToolBar UDF.

Indeed Siao it works :) Now i need to find a way to get "required" size to fill in all icons in the Launch Bar. Thanks!!

#include <WinAPI.au3>
#include <GuiReBar.au3>
#include <GuiToolbar.au3>
#include <Array.au3>
;~ #include <WindowsConstants.au3>

Global Const $SW_HIDE                           = 0
Global Const $SW_SHOW                           = 5

_ResizeQuickLaunchBar()

Func _ResizeQuickLaunchBar($fShow = True, $iIndex = 1)
    Local $hTaskBar, $hRebar, $hToolBar
    $hTaskBar = _WinAPI_FindWindow("Shell_TrayWnd", "")
    $hRebar = ControlGetHandle($hTaskBar, "", "ReBarWindow321")
    $hToolBar = ControlGetHandle($hRebar, "", "ToolbarWindow32" & $iIndex)
    $hToolBar2 = ControlGetHandle($hRebar, "", "ToolbarWindow322")

    MsgBox(0,1,_GUICtrlToolbar_ButtonCount($hToolBar2))
    _GUICtrlRebar_SetBandLength($hRebar, 0, 300)
EndFunc   ;==>_ShowProgramsShowingInTaskBar

My little company: Evotec (PL version: Evotec)

Link to comment
Share on other sites

Tada! It works! Thanks Siao :) For those interested code below.

#include <WinAPI.au3>
#include <GuiReBar.au3>
#include <GuiToolbar.au3>

_ResizeQuickLaunchBar()

Func _ResizeQuickLaunchBar()
    Local $hTaskBar = _WinAPI_FindWindow("Shell_TrayWnd", "")
    Local $hRebar = ControlGetHandle($hTaskBar, "", "ReBarWindow321")
    Local $hToolBar = ControlGetHandle($hRebar, "", "ToolbarWindow322")
    Local $user_icon_width = 24, $user_icon_height = 30
    Local $user_icons_count = _GUICtrlToolbar_ButtonCount($hToolBar)
    Local $user_icons_rows = _GUICtrlToolbar_GetRows($hToolBar)
    Local $user_bar_height = _GUICtrlRebar_GetRowHeight($hRebar,0)
    _GUICtrlRebar_SetBandLength($hRebar, 0, $user_icons_count/($user_bar_height/$user_icon_height)* $user_icon_width + 20)
EndFunc   ;==>_ShowProgramsShowingInTaskBar

My little company: Evotec (PL version: Evotec)

Link to comment
Share on other sites

  • Moderators

How about this...

#include <WinAPI.au3>
#include <GuiReBar.au3>

_ResizeQuickLaunchBar()

Func _ResizeQuickLaunchBar()
    Local $iIndex = 0
    Local $hTaskBar = _WinAPI_FindWindow("Shell_TrayWnd", "")
    Local $hRebar = ControlGetHandle($hTaskBar, "", "ReBarWindow321")
    _GUICtrlRebar_MinimizeBand($hRebar, $iIndex)
    _GUICtrlRebar_MaximizeBand($hRebar, $iIndex, True)
EndFunc   ;==>_ResizeQuickLaunchBar
Link to comment
Share on other sites

How about this...

#include <WinAPI.au3>
#include <GuiReBar.au3>

_ResizeQuickLaunchBar()

Func _ResizeQuickLaunchBar()
    Local $iIndex = 0
    Local $hTaskBar = _WinAPI_FindWindow("Shell_TrayWnd", "")
    Local $hRebar = ControlGetHandle($hTaskBar, "", "ReBarWindow321")
    _GUICtrlRebar_MinimizeBand($hRebar, $iIndex)
    _GUICtrlRebar_MaximizeBand($hRebar, $iIndex, True)
EndFunc   ;==>_ResizeQuickLaunchBar
Works great :) Less calculations and probably better way (proper) to do this :) Thanks

My little company: Evotec (PL version: Evotec)

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...