Force XP Start Menu

G

Guest

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\Explorer\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/d...orm/shell/reference/structures/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
 
G

Guest

I think:

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

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

Guest

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
 
G

Guest

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\Explorer"
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top