Sign in to follow this  
Followers 0
dazza

Show Quick Launch

8 posts in this topic

A tricky one...

I need AutoIt to do the following without mouseclicks:

1) Right click on the task bar

2) Select properties

3) Tick 'Show QuickLaunch'

I wouldn't know where to look :)

Share this post


Link to post
Share on other sites



A better method:

$bin = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop", "Default Taskbar")

RegWrite("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop", "Taskbar", "REG_BINARY", $bin)
RegWrite("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop", "TaskbarWinXP", "REG_BINARY", $bin)

Not tested but should work.

Share this post


Link to post
Share on other sites

A better method:

$bin = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop", "Default Taskbar")

RegWrite("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop", "Taskbar", "REG_BINARY", $bin)
RegWrite("HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop", "TaskbarWinXP", "REG_BINARY", $bin)

Not tested but should work.

Many, many thanks!

Share this post


Link to post
Share on other sites

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

_QuickLaunch_SetState(True)
_QuickLaunch_AutoSize()
Exit

;===============================================================================
;
; Function Name:    _QuickLaunch_SetState
; Description:      Enable/disable the quick launch toolbar
; Parameter(s):     $fState - Specifies whether to enable or disable the quick launch toolbar.
;                       True (1) = toolbar is enabled
;                       False (0) = toolbar is disabled
; Requirement(s):   Windows 2000 or XP
; Return Value(s):  Success - Return value from _SendMessage
;                   Failure - @error is set
;                   @error  - 1 = Invalid $fState, 2 = Unable to get handle for Shell_TrayWnd
; Author(s):        Bob Anthony (big_daddy)
;
;===============================================================================
;
Func _QuickLaunch_SetState($fState)
    Const $WM_USER = 0X400
    Const $WMTRAY_TOGGLEQL = ($WM_USER + 237)

    If $fState <> 0 And $fState <> 1 Then Return SetError(1, 0, 0)

    $hTrayWnd = WinGetHandle("[CLASS:Shell_TrayWnd]")
    If @error Then Return SetError(2, 0, 0)

    Return _SendMessage($hTrayWnd, $WMTRAY_TOGGLEQL, 0, $fState)
EndFunc   ;==>_QuickLaunch_SetState

Func _QuickLaunch_AutoSize()
    Local $iIndex = 0
    Local $hTaskBar = _WinAPI_FindWindow("Shell_TrayWnd", "")
    Local $hRebar = ControlGetHandle($hTaskBar, "", "ReBarWindow321")
    _GUICtrlRebar_MinimizeBand($hRebar, $iIndex)
    _GUICtrlRebar_MaximizeBand($hRebar, $iIndex, True)
EndFunc   ;==>_QuickLaunch_AutoSize

Share this post


Link to post
Share on other sites

Ack, I get an error. It looks like a simple one. Anyone know how to remedy the problem?

G:\Digitization AP\System Integration and Test\daz\Ben\ben.au3 (24) : ==> Can not redeclare a constant.:

Const $WM_USER = 0X400

Const ^ ERROR

>Exit code: 1 Time: 0.414

line 24 is:

Const $WM_USER = 0X400

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

Top stuff.

Many thanks

Share this post


Link to post
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
Sign in to follow this  
Followers 0