dazza Posted May 29, 2009 Share Posted May 29, 2009 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 Link to comment Share on other sites More sharing options...
Pain Posted May 29, 2009 Share Posted May 29, 2009 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. Link to comment Share on other sites More sharing options...
dazza Posted May 29, 2009 Author Share Posted May 29, 2009 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! Link to comment Share on other sites More sharing options...
Moderators big_daddy Posted May 29, 2009 Moderators Share Posted May 29, 2009 expandcollapse popup#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 Link to comment Share on other sites More sharing options...
KaFu Posted May 29, 2009 Share Posted May 29, 2009 Nice snippet big_daddy , saved... OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
dazza Posted June 2, 2009 Author Share Posted June 2, 2009 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 Link to comment Share on other sites More sharing options...
KaFu Posted June 2, 2009 Share Posted June 2, 2009 Change line 24 to ;Const $WM_USER = 0X400 as the Constant seems to be already declared (most likely in one of the includes). OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2022-Nov-26) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Feb-16) HMW - Hide my Windows (2018-Sep-16) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2023-Jun-03) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16) Link to comment Share on other sites More sharing options...
dazza Posted June 2, 2009 Author Share Posted June 2, 2009 Top stuff. Many thanks 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