Hi,
I will see if I can explain using a cascading menu for shutdown restart etc.
This information I got from tutorials here and just playing around to get it the way I wanted it.
I will post the full code at the very bottom of this post,
Just copy and paste in notepad and save as Power.reg or something.reg and double click it.
Then you can see how it looks in the right click menu.
note, not everything can be done with Right Click Context menus, some things just don't work, others require taking ownership of registry keys etc.
Be careful with what you are doing and trying to create, but don't be afraid to experiment.
First off, here is the original Power Cascading Menu from tutorials and where I started, then edited in the code below to fix it the way I like it.
http://www.eightforums.com/tutorial...-menu-windows-8-a.html?filter[1]=Context Menu
Code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\DesktopBackground\Shell\zMenu1]
"MUIVerb"="Power"
"SubCommands"="shutdown;restart;lock;|;logoff;|;abort;switchuser;|;hybridshutdown;hibernate;sleep"
"Icon"="powrprof.dll,-513"
"Position"="Bottom"
The above code is key to the whole thing. This defines how your cascading menu will look.
I can't remember exactly why I named this part zMenu1, could be I just wanted it in the Registry in that location. Or there might have been a reason from a code aspect. Not sure, but I apologize, I don't want to go back and find out right now.
"Icon"="powrprof.dll,-513"
This is the icon used for the menu item.,.. all of the icons I chose are default in Windows files
this is in that dll located in C:\Windows\System32
this is icon number 513 in powrprof.dll
Along with others
imageres.dll
shell32.dll
compstui.dll
DDORes.dll
ieframe.dll
mmcndmgr.dll
mmres.dll
moricons.dll
msctf.dll
netshell.dll
pnidui.dll
wmploc.DLL
Just to name a few... hehe
The best way to view these is use
IconViewer
Great app. Not all files contain icons,, to access this after install, right click a file and choose properties
If there are icons, a new tab will appear, otherwise it won't.
The | (pipe) adds separators in the menu
This list of SubCommands above are the order they will appear in the menu.
"Position"="Bottom"
This is where is will be located in the context menu,
Top
Middle
Bottom
Position is a little tricky, You will need to research this and play around with it a bit.
,,,,,,,,,,,,,
This code below is not really needed, I added it for a degree of completion,
This adds the right click power menu to the Computer Icon as well (on the desktop or in the start menu, if you have one, this does not apply to metro anywhere).
Code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\Menu1]
"MUIVerb"="Power"
"SubCommands"="shutdown;restart;lock;|;logoff;|;abort;switchuser;|;hybridshutdown;hibernate;sleep"
"Icon"="powrprof.dll,-513"
"Position"="Bottom"
****************************************
This is the full code for the registry file,
Code:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\Menu1]
"MUIVerb"="Power"
"SubCommands"="shutdown;restart;lock;|;logoff;|;abort;switchuser;|;hybridshutdown;hibernate;sleep"
"Icon"="powrprof.dll,-513"
"Position"="Bottom"
[HKEY_CLASSES_ROOT\DesktopBackground\Shell\zMenu1]
"MUIVerb"="Power"
"SubCommands"="shutdown;restart;lock;|;logoff;|;abort;switchuser;|;hybridshutdown;hibernate;sleep"
"Icon"="powrprof.dll,-513"
"Position"="Bottom"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\shutdown]
@="Shutdown"
"icon"="shell32.dll,-28"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\shutdown\command]
@="shutdown.exe -s -t 00 -f"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\restart]
@="Restart"
"icon"="SyncCenter.dll,-1220"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\restart\command]
@="shutdown.exe -r -t 00 -f"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\lock]
@="Lock Computer"
"icon"="shell32.dll,-48"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\lock\command]
@="rundll32.exe user32.dll, LockWorkStation"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\logoff]
@="Log Off"
"icon"="shell32.dll,-45"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\logoff\command]
@="shutdown.exe -L"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\abort]
@="Abort"
"icon"="imageres.dll,-98"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\abort\command]
@="shutdown.exe -A"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\switchuser]
@="Switch User"
"icon"="imageres.dll,-88"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\switchuser\command]
@="tsdiscon.exe"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\sleep]
@="Sleep"
"Icon"="powercpl.dll,-514"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\sleep\command]
@="rundll32.exe powrprof.dll,SetSuspendState Sleep"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\hibernate]
@="Hibernate"
"icon"="imageres.dll,-1013"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\hibernate\command]
@="Shutdown -h"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\hybridshutdown]
@="Shut Down (Hybrid)"
"icon"="imageres.dll,-1022"
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\hybridshutdown\command]
@="Shutdown -s -f -t 00 -hybrid"
****************************
This will uninstall it....
Code:
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\Menu1]
[-HKEY_CLASSES_ROOT\DesktopBackground\Shell\zMenu1]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\shutdown]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\restart]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\lock]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\logoff]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\abort]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\switchuser]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\sleep]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\hibernate]
[-HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\CommandStore\shell\hybridshutdown]
I hope this helps a little with explaining how to create a cascading right click context menu.
Also see this one,, but this one requires taking ownership of a registry key
http://www.eightforums.com/tutorials/9477-personalize-add-remove-expanding-desktop-context-menu.html
And this...
Context Menus