;FUNCTION ModifyStartMenu()
;
;ACTION Modifies the Start Menu and Taskbar options
;
;AUTHOR NTDOC
;
;HELP BY: Bryce wrote code to update binary values.
;
;SYNTAX None
;
;PARAMETERS $regstring[52] = "06"
; $regstring[8] = "06"
; Selects which binary value to edit - see table
; $regstate[32]="00"
; Sets XP Menu Style - see table
;
;RETURN 0 if successful, otherwise error code
;
;REMARKS Please read all documentation for options
;
;KIXTART VER 4.12
;
;DEPENDENCIES Latest version of WMI and KiXtart 4.12
;
;TESTED ON Windows 98SE, NT, 2000, XP
;
;EXAMPLE $ReturnCode=ModifyStartMenu
;
;KIXTART BBS http://www.kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=12&t=000279
;
;Documentation and Code below

Modifying the Start Menu Options via KiXtart

In order to modify the Start Menu Options via a Regedit or programmatically
you need to make the modification first, then either log off or end task the
shell (explorer.exe) and your new settings will take affect. The reason is
that these settings appear to first be stored in volatile memory and are
then written to the Registry when you log off. The GUI apparently makes
some kind of undocumented API call to have Explorer reload its settings,
which you are not able to do with a simple Regedit change. There also
appears to be a state that can't be achieved via the GUI, which is to use
the Classic Menu and Small Icons, but can be done via Regedit.

Windows XP: Shell State XP Menu or Classic Menu
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
ShellState
Reg_Binary - The 33rd binary value controls this state.
00=Classic Menu 02=XP Menu

Windows XP: Large/Small Icons
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
Start_LargeMFUIcons
DWORD 1 Enables large icons 0 Disables large icons when using the XP Menu and
not the Classic Menu. The Classic Menu does not use the Start_LargeMFUIcons
settings

Windows XP: Lock the Taskbar Menu
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
TaskbarSizeMove
DWORD 1 Disables locking the taskbar 0 Enables locking the taskbar

Windows XP: Group Similar Tasbar Buttons
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced
TaskbarGlomming
DWORD 1 Enables grouping similar buttons 0 Disables grouping similar buttons

Windows Start Menu options are controlled by the following Registry locations.
Windows 2000 and XP use the 9th binary value and Windows NT uses the 53 binary
value as shown in the table below.

Windows 2000 and XP
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2
Settings
Windows NT 4.0
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects
Settings
Windows 9x
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects
Settings

SINGLE OPTIONS:
08 = No Settings Enabled
09 = Auto Hide
00 = Show Clock
0A = Always on Top
0C = Show small icons in Start Menu

MULTIPLE OPTIONS:
01 = Auto Hide and Show Clock
02 = Always on Top and Show Clock
03 = Always on Top and Auto Hide and Show Clock
04 = Show small icons in Start Menu and Show Clock
0E = Always on Top and Show small icons in Start Menu
0F = Always on Top and Auto Hide and Show small icons in Start Menu
06 = Always on Top and Show small icons in Start Menu and Show Clock
07 = All Options Enabled
0B = Always on Top and Auto Hide
0D = Auto Hide and Show small icons in Start Menu


 Code:
Function ModifyStartMenu()
dim $ars, $i, $count, $settings, $x
If @INWIN=1
    $ARS = writevalue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon","AutoRestartShell","1","REG_DWORD")
EndIF
Select
    Case @PRODUCTTYPE="Windows 95"
        $settings = readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects","settings")
    Case @PRODUCTTYPE="Windows 98"
        $settings = readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects","settings")
    Case @PRODUCTTYPE="Windows Me"
        $settings = readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects","settings")
    Case @PRODUCTTYPE="Windows NT Workstation"
        $settings = readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects","settings")
    Case @PRODUCTTYPE="Windows 2000 Professional"
        $settings = readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2","settings")
    Case @PRODUCTTYPE="Windows XP Professional"
        $settings = readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2","settings")
    Case 1
        Return
EndSelect

Dim $regstring[(len($settings)/2)-1]

for $i = 1 to len($settings) step 2
    $regstring[$count] = substr($settings,$i,2)
    $count = $count + 1
next

Select
    Case @PRODUCTTYPE="Windows 95"
        $regstring[8] = "06"
        $x = writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects","settings",join($regstring,""),"REG_BINARY")
    Case @PRODUCTTYPE="Windows 98"
        $regstring[8] = "06"
        $x = writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects","settings",join($regstring,""),"REG_BINARY")
    Case @PRODUCTTYPE="Windows Me"
        $regstring[8] = "06"
        $x = writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects","settings",join($regstring,""),"REG_BINARY")
    Case @PRODUCTTYPE="Windows NT Workstation"
        $regstring[52] = "06"
        $x = writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects","settings",join($regstring,""),"REG_BINARY")
    Case @PRODUCTTYPE="Windows 2000 Professional"
        $regstring[8] = "06"
        $x = writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2","settings",join($regstring,""),"REG_BINARY")
    Case @PRODUCTTYPE="Windows XP Professional"
        $regstring[8] = "06"
        $x = writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects2","settings",join($regstring,""),"REG_BINARY")
    Case 1
        Return
EndSelect

If @PRODUCTTYPE="Windows XP Professional"
    $state = readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer","shellstate")
Dim $regstate[(len($state)/2)-1]
$count = 0
For $i = 1 to len($state) step 2
    $regstate[$count] = substr($state,$i,2)
    $count = $count + 1
next
    $regstate[32]="00" ; 00=Classic Menu  02=XP Menu
    ; Start_LargeMFUIcons value of 1=Use Large Icons in XP Menu 0=Use Small Icons in XP Menu
    $x = WriteValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced", "Start_LargeMFUIcons","0", "REG_DWORD")
    $x = writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer","shellstate",join($regstate,""),"REG_BINARY")
Endif
$COMPUTER=@WKSTA
$PROC = "EXPLORER.EXE"
For each $Process in GetObject("winmgmts:{impersonationLevel=impersonate}!//$COMPUTER").ExecQuery("select * from Win32_Process where Name='$PROC'")
    $x=$Process.Terminate
Next
If @INWIN=2
    Run "Explorer"
Endif
EndFunction


 Code:
OPTIONS TABLE
SINGLE OPTIONS:
08 = No Settings Enabled
09 = Auto Hide
00 = Show Clock
0A = Always on Top
0C = Show small icons in Start Menu

MULTIPLE OPTIONS:
01 = Auto Hide and Show Clock
02 = Always on Top and Show Clock
03 = Always on Top and Auto Hide and Show Clock
04 = Show small icons in Start Menu and Show Clock
0E = Always on Top and Show small icons in Start Menu
0F = Always on Top and Auto Hide and Show small icons in Start Menu
06 = Always on Top and Show small icons in Start Menu and Show Clock
07 = All Options Enabled
0B = Always on Top and Auto Hide
0D = Auto Hide and Show small icons in Start Menu