Tech Support > Microsoft Windows > Security & Administration > Force XP Start Menu
Force XP Start Menu
Posted by Tim on May 8th, 2006


There is a GPO to force the Classic XP start Menu located under user
policy in Administrative Tools\System\Start Menu and Taskbar\Force Classic
Start Menu, however there is no GPO to force the XP start menu. The start
menu state is stored in the Registry Key
HKCU\Software\Microsoft\Windows\CurrentVersion\Exp lorer\ShellState which is a
Binary value, the start menu state is stored in bit positions 7 and 8.
Classic is 00 and XP is 02. However in order to changing this key is not
enough the OS must be notified to switch the menu once the user is logged on.
The ShellState object
(http://msdn.microsoft.com/library/de...shellstate.asp)
must be used and then the OS must be notified. I found an example of how to
do this in delphi (http://www.swissdelphicenter.ch/en/showcode.php?id=2448)
but I was wondering if anyone had any idea how this could be done in C++ or
vbscript or if anyone had any better ideas of how to change this while the
user was logged in.

Thanks for any help that anyone can provide.

tim

Posted by Ian on May 8th, 2006


I think:

cd \windows\system32
RUNDLL32.EXE user32.dll,UpdatePerUserSystemParameters

will do this. It certainly resets the wallpaper, etc.

-------------------------------

An alternative approach to XP network logon - http://mylogon.net


Posted by Tim on May 8th, 2006


Thanks IAN,

That is a great idea, it doesn't appear to re-load the ShellState but I will
do some additional research to see if there is another method in user32.dll
that I can call. Thanks for a the starting point.

tim

"Ian" wrote:

Posted by Tim on May 8th, 2006


So far I have been able to manipulate the reg key using the following vbscript:

Option Explicit
Const HKCU = &H80000001
Dim objWMIReg
Dim arrShellState
Dim strRegPath
Dim strRegValue
Dim intCount
Set objWMIReg = GetObject("Winmgmts:\root\default:StdRegProv")
strRegPath = "Software\Microsoft\Windows\CurrentVersion\Explore r"
strRegValue = "ShellState"
objWMIReg.GetBinaryValue HKCU,strRegPath,strRegValue,arrShellState
arrShellState(32) = 2
objWMIReg.SetBinaryValue HKCU,strRegPath,strRegValue,arrShellState


Now I am wondering if anyone out there knows how to notify the desktop of
the change. I think Ian was very close but I have been unable to find a
method in user32.dll or shell32.dll to do the trick. The following is an
exerpt from some delphi code that is supposed to do it but I can't figure out
what it is trying to do. The full code is posted here:
http://www.swissdelphicenter.ch/en/showcode.php?id=2448

PostMessage(FindWindow('Progman', nil), WM_USER + $60, 0, 0);
PostMessage(FindWindow('Shell_TrayWnd', nil), WM_USER + $0D, 0, 0);

Thanks again to IAN for the valuable starting point,

tim


"Ian" wrote: