Page 2 of 2 <12
Topic Options
#189438 - 2008-09-04 04:26 PM Re: Check if the Quick Launch Toolbar is enabled [Re: Glenn Barnas]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Glenn,
Look at the 18th charachter in the string. It is a 2. I would have thought your Quick Launch toolbar is disabled. But looking at the length of the string, I would say it is enabled.
These are the values under the registry key HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop when I disable the Quick Launch Toolbar (and log off and log on again)
 Code:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop]
"TaskbarWinXP"=hex:0c,00,00,00,08,00,00,00,02,00,00,00,00,00,00,00,aa,4f,28,68,\
  48,6a,d0,11,8c,78,00,c0,4f,d9,18,b4,e5,03,00,00,60,0d,00,00,00,00,00,00,1e,\
  00,00,00,00,00,00,00,00,00,00,00,1e,00,00,00,00,00,00,00,01,00,00,00,01,00,\
  00,00,8b,8a,0d,54,3f,1c,32,4e,81,32,53,0f,6a,50,20,90,1d,00,00,00,60,05,00,\
  00,00,00,00,00,1c,00,00,00,00,00,00,00,00,00,00,00,1c,00,00,00,00,00,00,00,\
  01,00,00,00
"Toolbars"=hex:11,00,00,00,00,00,00,00
"Upgrade"=dword:00000001

Top
#189458 - 2008-09-05 10:11 AM Re: Check if the Quick Launch Toolbar is enabled [Re: NTDOC]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
 Originally Posted By: NTDOC
Yes, but they say the same thing about having to kill explorer shell which is not good.

 Quote:
I found out that if you try this while Explorer is running the settings are overwritten on Windows shutdown. Kill the explorer process to prevent this.

Thats not true, I tested this script and it works perfectly you see if enable and disable quicklaunch 4 times without killing the explorer process. I think im losing my KiX religion ;\)

Top
#189466 - 2008-09-05 12:56 PM Re: Check if the Quick Launch Toolbar is enabled [Re: Witto]
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4396
Loc: New Jersey
 Originally Posted By: Witto
Glenn,
Look at the 18th charachter in the string. It is a 2.

Yes, but the 18th character is not extracted by Right($BigString, 1)!!! ;\)

What I was pointing out was that I got much more data in the string than you first indicated, so Right(string, 1) may not work, but SubStr($String, 18, 1) might.

Also, when I ran RegMon on the Vista Business system, the registry updated immediately when I enabled or disabled QL, yet the value from Vista Ultimate did not change between tests.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#189575 - 2008-09-10 03:36 PM Re: Check if the Quick Launch Toolbar is enabled [Re: Glenn Barnas]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
I have looked at the value for TaskbarWinXP under the RegKey HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop on different computers for different users where the QL Toolbar is disabled.
  • At first logon to a computer, when the Userprofile is created, there is no RegKey Desktop under Streams
  • This is a list of values for TaskbarWinXP:
     Code:
    0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b4b7020000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000
    0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b4db020000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000
    0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b4c9030000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000
    0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b4c9020000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000
    0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b4ff030000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000
    0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b4ed030000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000
    0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b4e5030000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000

    Length = 248 characters
    Left 64 chars are the same
    Right 180 chars are the same

Top
#189602 - 2008-09-11 12:37 AM Re: Check if the Quick Launch Toolbar is enabled [Re: Witto]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
I presume this script can check if the Quick Launch Toolbar is disabled on Windows XP:
;************************************************************************* 
; Script Name: EnableQLToolbar
; Author: Wim Rotty
; Date: 2008/9/11
; Description: Enable Quick Launch Toolbar only if it is disabled
;*************************************************************************

;;;;;;;;;;;;;;;;;;
; Script Options ;
;;;;;;;;;;;;;;;;;;

If Not @LOGONMODE
Break On
Else
Break Off
EndIf
Dim $RC
$RC = SetOption("Explicit", "On")
$RC = SetOption("NoMacrosInStrings", "On")
$RC = SetOption("NoVarsInStrings", "On")
If @SCRIPTEXE = "KIX32.EXE"
$RC = SetOption("WrapAtEOL", "On")
EndIf

;;;;;;;;;;;;;;;;;;;;;
; Declare variables ;
;;;;;;;;;;;;;;;;;;;;;

DIM $TaskbarWinXP

;;;;;;;;
; Code ;
;;;;;;;;

; -- QL: Enable Quick Launch Toolbar
; Check if OS is Windows XP
If @DOS = "5.1"
; $TaskbarWinXP = ReadValue('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop','TaskbarWinXP')
$TaskbarWinXP = ReadValue('HKEY_USERS\'+@SID+'\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop','TaskbarWinXP')
; Check if Quick Launch Toolbar is disabled
If
; Check if RegName TaskbarWinXP exists
@ERROR<>0
Or
; Check if the Value for TaskbarWinXP is 248 chars long
Len($TaskbarWinXP)=248 And
; Check the left 64 chars of the Value for TaskbarWinXP
Left($TaskbarWinXP,64)='0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b4' And
; Check the right 180 chars of the Value for TaskbarWinXP
Right($TaskbarWinXP,180)='0000600d0000000000001e00000000000000000000001e0000000000000001000000010000008'+
'b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000'
; ? "Disabled"
Shell '"%ComSpec%" /C "'+@LSERVER+'\NETLOGON\toggleql.exe" 1'
; Else
; ? "Enabled"
EndIf
EndIf

Top
#189963 - 2008-10-01 02:49 PM Re: Check if the Quick Launch Toolbar is enabled [Re: Witto]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
I have been collecting more values for TaskBarWinXP and have to review the previous script. For all these values, the QuickLaunch Taskbar was disabled:
 Code:
0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b4b7020000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000
0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b4db020000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000
0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b4c9030000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000
0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b4c9020000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000
0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b4ff030000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000
0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b4ed030000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000
0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b455030000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000
0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b455030000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901d00000060050000000000001c00000000000000000000001c0000000000000001000000
0c000000080000000100000000000000aa4f2868486ad0118c7800c04fd918b477030000e00c0000000000001e00000000000000000000001e0000000000000001000000
0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b45d030000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020902d00000060050000000000001c00000000000000000000001c0000000000000001000000
0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b466030000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020901400000060050000000000001c00000000000000000000001c0000000000000001000000
0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b4cb030000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020902d00000060050000000000001c00000000000000000000001c0000000000000001000000
0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b493030000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020902d00000060050000000000001c00000000000000000000001c0000000000000001000000
0c000000080000000200000000000000aa4f2868486ad0118c7800c04fd918b481030000600d0000000000001e00000000000000000000001e0000000000000001000000010000008b8a0d543f1c324e8132530f6a5020902d00000060050000000000001c00000000000000000000001c0000000000000001000000

I think checking for the existance and the length of the value should be enough to avoid that double and triple QuickLaunch Taskbars get created.
;*************************************************************************
; Script Name: EnableQLToolbar
; Author: Wim Rotty
; Date: 2008/9/11
; Description: Enable Quick Launch Toolbar only if it is disabled
;*************************************************************************


;;;;;;;;;;;;;;;;;;
; Script Options ;
;;;;;;;;;;;;;;;;;;


If
Not @LOGONMODE
    Break On
Else
    Break Off
EndIf
Dim $RC
$RC = SetOption("Explicit", "On")
$RC = SetOption("NoMacrosInStrings", "On")
$RC = SetOption("NoVarsInStrings", "On")
If @SCRIPTEXE = "KIX32.EXE"
    $RC = SetOption("WrapAtEOL", "On")
EndIf

;;;;;;;;;;;;;;;;;;;;;
; Declare variables ;
;;;;;;;;;;;;;;;;;;;;;


DIM
$TaskbarWinXP

;;;;;;;;
; Code ;
;;;;;;;;


; -- QL: Enable Quick Launch Toolbar
; Check if OS is Windows XP

If
@DOS
=
"5.1"
    ; $TaskbarWinXP = ReadValue('HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop','TaskbarWinXP')
    $TaskbarWinXP = ReadValue('HKEY_USERS\'+@SID+'\Software\Microsoft\Windows\CurrentVersion\Explorer\Streams\Desktop','TaskbarWinXP')
   
; Check if Quick Launch Toolbar is disabled
    If
    ; Check if RegName TaskbarWinXP exists
    @ERROR<>0
   
Or
    ; Check if the Value for TaskbarWinXP is at least 248 chars long
    Len($TaskbarWinXP)<=248
       
; ? "Disabled"
        Shell '"%ComSpec%" /C "'+@LSERVER+'\NETLOGON\toggleql.exe" 1'
    ; Else
        ; ? "Enabled"
    EndIf
EndIf

Top
#189970 - 2008-10-01 05:57 PM Re: Check if the Quick Launch Toolbar is enabled [Re: Witto]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
I finally found a way in KiX to be able to enable and disable the QuickLaunch bar. However it doesn't return the state, I spend hours figuring this out and finally had to resort to an external DLL that let's you make DLL Calls, I hope Ruud will incorporate this into KiX.

Anyway here's what you need: DynaWrapper

And here the code, after hours of sorting it out:
 Code:
Function ToggleQL($switch)
  Dim $WM_USER, $WMTRAY_TOGGLEQL, $objItem, $lhWnd
  $WM_USER = &400
  $WMTRAY_TOGGLEQL = ($WM_USER + 237)
  $objItem = CreateObject("DynamicWrapper")
  $=$objItem.Register("USER32.DLL", "FindWindowA", "i=ss", "f=s", "r=l")
  $=$objItem.Register("USER32.DLL", "SendMessage", "I=hlll", "f=s", "R=l")
  $lhWnd = $objItem.FindWindowA("Shell_TrayWnd", "")
  $=$objItem.SendMessage($lhWnd, $WMTRAY_TOGGLEQL, -1, $switch)
EndFunction

The switch = 0 for off and 1 for on.

Top
#189977 - 2008-10-02 02:59 AM Re: Check if the Quick Launch Toolbar is enabled [Re: Witto]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
I like it. Now can you explain it, so I can learn from it. How did you figure out what values to use.
Top
#189981 - 2008-10-02 09:31 AM Re: Check if the Quick Launch Toolbar is enabled [Re: Allen]
Arend_ Moderator Offline
MM club member
*****

Registered: 2005-01-17
Posts: 1894
Loc: Hilversum, The Netherlands
The readme.txt included in the zip explains the I, F and R switches.
Basically I google'd alot to see what how it is done in C/C++ and in AutoIT. Keep comparing and you'll find out which switches you need.

I posted the link to the AutoIT script earlier in this thread that does the same thing as mine. I basically translated that.

Top
#190026 - 2008-10-05 06:36 AM Re: Check if the Quick Launch Toolbar is enabled [Re: Arend_]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Hey Arend, would you mind posting this to the UDFs?
Top
#190034 - 2008-10-06 05:36 PM Re: Check if the Quick Launch Toolbar is enabled [Re: Allen]
Witto Offline
MM club member
*****

Registered: 2004-09-29
Posts: 1828
Loc: Belgium
Whow Arend,
I will take a look at that. Sounds nice.
Apparently this DynaWrapper has much more potential.

Top
#194607 - 2009-07-07 03:55 PM Re: Check if the Quick Launch Toolbar is enabled [Re: Allen]
Dynamite Dan Offline
Fresh Scripter

Registered: 2003-04-29
Posts: 20
Loc: België
this VB script toggels the "quick launch" setting.

 Code:
Option Explicit
Dim ShellObject
Set ShellObject=WScript.CreateObject("WScript.Shell")
ShellObject.Run("rundll32.exe shell32.dll,Options_RunDLL 1") 
WScript.Sleep 200 
ShellObject.AppActivate "Taskbar and Start Menu Properties"
ShellObject.SendKeys "%Q" 
WScript.Sleep 200 
ShellObject.AppActivate "Taskbar and Start Menu Properties" 
ShellObject.Sendkeys"%A" 
WScript.Sleep 200
ShellObject.AppActivate "Taskbar and Start Menu Properties"
ShellObject.Sendkeys"{ENTER}"

could it be rewriten in kix?

Top
Page 2 of 2 <12


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 507 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.062 seconds in which 0.024 seconds were spent on a total of 14 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org