fu2m8 Posted July 24, 2006 Share Posted July 24, 2006 Hey Guys, Script Objective: Enabling the Quick Launch Toolbar I was wondering if any1 knows of a quick way to call the "Taskbar and Start Menu Properties" window. Basically i have a script that calls control.exe (Control Panel) > waits a few seconds > sends the keys "task" > presses Enter (this opens the said window) and i then have a couple of controlclick commands to enable the Show Quick Launch option if it is not already enabled. The only part that i think the script will fall down, is the opening of control panel and the sending of the keys to highlight the "Taskbar and ..." applet (if the window loses focus etc). I was hoping someone might know of a way to call this applet directly (e.g i know you can call Add/remove programs by running appwiz.cpl from the command line and i know that there are certain options you can pass to control.exe to get to certain windows/tabs for control panel applets, however it doesn't look like this is one of them) therefore by passing the send keys command and simply going straight to the control click stuff (would hopefully make the script more bulletproof). I thought it might be possible using a rundll32 command or something along those lines but i haven't had much experience with this and couldn't find and relevant stuff using google. Here's the code: Run(@SystemDir & "\control.exe") WinExists("Control Panel") WinActivate("Control Panel") Sleep(3000) Send("task") ;Hopefully should highlight the Taskbar settings applet Sleep(1000) Send("{ENTER}") WinExists("Taskbar and Start Menu Properties", "Taskbar") Sleep(1000) $ischecked = ControlCommand("Taskbar and Start Menu Properties","Taskbar", 1107, "IsChecked", "") ;Var to check if it is already enable or not If $ischecked = 0 Then ;If it = 0 then it is unchecked and needs to be clicked ControlClick("Taskbar and Start Menu Properties", "Taskbar", 1107) Sleep(500) ControlClick("Taskbar and Start Menu Properties", "Taskbar", 1) Else ControlClick("Taskbar and Start Menu Properties", "Taskbar", 1) ;Simply clicks the OK button EndIf Sleep(1000) WinClose("Control Panel") Exit Thanks Guys!! P.S If any1 knows of a better way of enabling the quick launch toolbar through registry or alternative method i would love to hear about it! Link to comment Share on other sites More sharing options...
ACalcutt Posted July 24, 2006 Share Posted July 24, 2006 (edited) this may help you a little Run("RunDll32.exe shell32.dll,Options_RunDLL 1");open taskbar and start menu properties if i remember right i had trouble changing those options by registry and went back to the gui approach expandcollapse popupFunc _Taskbar($settings) ;----------------------------------------------------------------------------- ; AutoIt Version: 3.1.0 ; Author:Andrew Calcutt Date:02/01/2006 ; Script Function: Sets Taskbar Options ;----------------------------------------------------------------------------- Run("RunDll32.exe shell32.dll,Options_RunDLL 1");open taskbar and start menu properties WinWaitActive("Taskbar and Start Menu Properties") While WinExists("Taskbar and Start Menu Properties") If IniRead($settings, "Taskbar", "LockTaskbar", "0") = 1 Then If ControlCommand("Taskbar and Start Menu Properties", "", "Button1", "IsChecked", "") = 0 Then ControlClick("Taskbar and Start Menu Properties", "", "Button1") Else If ControlCommand("Taskbar and Start Menu Properties", "", "Button1", "IsChecked", "") = 1 Then ControlClick("Taskbar and Start Menu Properties", "", "Button1") EndIf If IniRead($settings, "Taskbar", "AutoHideTaskbar", "0") = 1 Then If ControlCommand("Taskbar and Start Menu Properties", "", "Button2", "IsChecked", "") = 0 Then ControlClick("Taskbar and Start Menu Properties", "", "Button2") Else If ControlCommand("Taskbar and Start Menu Properties", "", "Button2", "IsChecked", "") = 1 Then ControlClick("Taskbar and Start Menu Properties", "", "Button2") EndIf If IniRead($settings, "Taskbar", "KeepTaskbarOnTop", "0") = 1 Then If ControlCommand("Taskbar and Start Menu Properties", "", "Button3", "IsChecked", "") = 0 Then ControlClick("Taskbar and Start Menu Properties", "", "Button3") Else If ControlCommand("Taskbar and Start Menu Properties", "", "Button3", "IsChecked", "") = 1 Then ControlClick("Taskbar and Start Menu Properties", "", "Button3") EndIf If IniRead($settings, "Taskbar", "Group", "0") = 1 Then If ControlCommand("Taskbar and Start Menu Properties", "", "Button4", "IsChecked", "") = 0 Then ControlClick("Taskbar and Start Menu Properties", "", "Button4") Else If ControlCommand("Taskbar and Start Menu Properties", "", "Button4", "IsChecked", "") = 1 Then ControlClick("Taskbar and Start Menu Properties", "", "Button4") EndIf If IniRead($settings, "Taskbar", "ShowQuickLaunch", "0") = 1 Then If ControlCommand("Taskbar and Start Menu Properties", "", "Button5", "IsChecked", "") = 0 Then ControlClick("Taskbar and Start Menu Properties", "", "Button5") Else If ControlCommand("Taskbar and Start Menu Properties", "", "Button5", "IsChecked", "") = 1 Then ControlClick("Taskbar and Start Menu Properties", "", "Button5") EndIf If IniRead($settings, "Taskbar", "ShowClock", "0") = 1 Then If ControlCommand("Taskbar and Start Menu Properties", "", "Button6", "IsChecked", "") = 0 Then ControlClick("Taskbar and Start Menu Properties", "", "Button6") Else If ControlCommand("Taskbar and Start Menu Properties", "", "Button6", "IsChecked", "") = 1 Then ControlClick("Taskbar and Start Menu Properties", "", "Button6") EndIf If IniRead($settings, "Taskbar", "HideInactiveIcons", "0") = 1 Then If ControlCommand("Taskbar and Start Menu Properties", "", "Button7", "IsChecked", "") = 0 Then ControlClick("Taskbar and Start Menu Properties", "", "Button7") Else If ControlCommand("Taskbar and Start Menu Properties", "", "Button7", "IsChecked", "") = 1 Then ControlClick("Taskbar and Start Menu Properties", "", "Button7") EndIf If ControlCommand("Taskbar and Start Menu Properties", "", "Button13", "IsEnabled", "") = 1 Then ControlClick("Taskbar and Start Menu Properties", "", "Button13") WinClose("Taskbar and Start Menu Properties") WEnd EndFunc;==>_Taskbar -edit i went back and looked at my origional code .. this is what i had origionally.. Func _Taskbar($settings, $HKUS1521) ; ---------------------------------------------------------------------------- ;----------------------------------------------------------------------------- ; AutoIt Version: 3.1.0 ; Author:Andrew Calcutt Date:08/09/2005 ; Script Function: Sets Taskbar Options ;----------------------------------------------------------------------------- ;----------------------------------------------------------------------------- _IniReadRegWrite($settings, "Taskbar", "LockTaskbar", $HKUS1521 & "\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarSizeMove", "REG_DWORD", "0x00000000", "0x00000001") _IniReadRegWrite($settings, "Taskbar", "Group", $HKUS1521 & "\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "TaskbarGlomming", "REG_DWORD", "0x00000001", "0x00000000") _IniReadRegWrite($settings, "Taskbar", "HideInactiveIcons", $HKUS1521 & "\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "EnableAutoTray", "REG_DWORD", "0x00000001", "0x00000000") EndFunc ;==>_Taskbar i don't think i was able to get anything else to work by registry in the taskbar settings Edited July 24, 2006 by ACalcutt Andrew Calcutt Http://www.Vistumbler.net Http://www.TechIdiots.net Its not an error, its a undocumented feature Link to comment Share on other sites More sharing options...
fu2m8 Posted July 24, 2006 Author Share Posted July 24, 2006 this may help you a little Run("RunDll32.exe shell32.dll,Options_RunDLL 1");open taskbar and start menu properties if i remember right i had trouble changing those options by registry and went back to the gui approach thx mate, worked a treat Link to comment Share on other sites More sharing options...
fu2m8 Posted July 24, 2006 Author Share Posted July 24, 2006 Just another quick question. Is there anyway to set the Quick Launch toolbar to display how many items are in it?? (for example when the option is selected by default 3 icons are shown, i have 9 icons in my Quick Launch is there anyway to have it automatically show all these icons) Thanks Guys Link to comment Share on other sites More sharing options...
Squirrely1 Posted July 24, 2006 Share Posted July 24, 2006 (edited) Just another quick question. Is there anyway to set the Quick Launch toolbar to display how many items are in it?? (for example when the option is selected by default 3 icons are shown, i have 9 icons in my Quick Launch is there anyway to have it automatically show all these icons)Thanks GuysRight-click on an empty place on the taskbar and uncheck Lock the Taskbar. With your mouse, drag the vertical lines that appear on either side of quicklaunch to reposition or resize the space allotted for icons there. When you are done with your changes, Lock the Taskbar again if you want to. Edited July 24, 2006 by Squirrely1 Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
fu2m8 Posted July 24, 2006 Author Share Posted July 24, 2006 Right-click on an empty place on the taskbar and uncheck Lock the Taskbar. With your mouse, drag the vertical lines that appear on either side of quicklaunch to reposition or resize the space allotted for icons there. When you are done with your changes, Lock the Taskbar again if you want to.my apologies i just realised i didnt state in the question but is there anyway to automate or script this functionality?? Link to comment Share on other sites More sharing options...
Squirrely1 Posted July 26, 2006 Share Posted July 26, 2006 my apologies i just realised i didnt state in the question but is there anyway to automate or script this functionality??There is probably no easy way to do this; it was intended that Windows user just know how their desktops work and adjust the Quick Launch from time to time to suit their current needs. But you could get pretty far seeing what is required by doing a Google search of these terms together: VBS taskbar lock quicklaunch Das Häschen benutzt Radar Link to comment Share on other sites More sharing options...
mhm313 Posted May 6, 2007 Share Posted May 6, 2007 This is my way of achieving this Run("Rundll32.exe SHELL32.DLL,Options_RunDLL 1") WinWait("Taskbar and Start Menu Properties") ControlCommand("Taskbar and Start Menu Properties","","Button5","Check") Sleep(2000) ControlClick("Taskbar and Start Menu Properties","","Button13") ControlClick("Taskbar and Start Menu Properties","","Button11") Link to comment Share on other sites More sharing options...
GEOSoft Posted May 6, 2007 Share Posted May 6, 2007 Another way would be to setup the taskbar the way you want it and then export the TaskbarWinXP value of HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop\to get the value that you always want to use.Then you could just do a regwrite to reset it to the proper value'Remember that this value is written in hex George Question about decompiling code? Read the decompiling FAQ and don't bother posting the question in the forums.Be sure to read and follow the forum rules. -AKA the AutoIt Reading and Comprehension Skills test.*** The PCRE (Regular Expression) ToolKit for AutoIT - (Updated Oct 20, 2011 ver:3.0.1.13) - Please update your current version before filing any bug reports. The installer now includes both 32 and 64 bit versions. No change in version number. Visit my Blog .. currently not active but it will soon be resplendent with news and views. Also please remove any links you may have to my website. it is soon to be closed and replaced with something else. "Old age and treachery will always overcome youth and skill!" 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