You can add to the (right click) context menu of a file type (say .min
is of type myFile => HKCR\.min has default property myFile) by putting
into the registry:
HKCR\myFile\shell\open (with defualt key something like: &Open with
myProg
HKCR\myFile\shell\open\command (with default key something like: c:
\winapps\myProg.exe "%1" %*

To add this context menu for all files (for example, for your favorite
editor), replace myFile with * (asterisk) in the above. Furthermore,
you could replace open, above, with Cmd or Edit or Edit2 since it is
only used for ordering within the context menu (not 100% true since
there are some special words like open). If there is a conflict
between
HKCR\myFile\shell\myCmd and
HKCR\*\shell\myCmd
then the more specific one (with myFile) is used
Nifty.

I have two questions:
1. Is there a simple minded way to get a multi level entry in the
context menu?
In other words, suppose I want (within the context menu) a right arrow
at the right of &Open with myProg which will then display:
myProg options
so that if I click on that my script can do its thing and show me an
options dialog. This would help alleviate clutter in my context menu.

There is an example of multi level menus with
WinZip -> Add to recently used Zip file -> ... zip file list ...,
although they have their own context menu handler so it's not simple
minded in the sense of only requiring trivial registry changes.

2. The simple introductory example at the top (with the asterisk (*))
inserts the menu item when right clicking of any explorer file. It
does not insert the menu when clicking over a folder or over empty
space in explorer. Is there a simple way to hook the menu in for
either of those cases?

Thanks for any tips,
Csaba Gabor from Vienna

Re: Multilevel Explorer context menus by Ayush

Ayush
Sun Jan 28 08:44:44 CST 2007

Replied to [Csaba Gabor]s message :
> 1. Is there a simple minded way to get a multi level entry in the
> context menu? In other words, suppose I want (within the context menu) a right arrow
> at the right of &Open with myProg which will then display:
> myProg options so that if I click on that my script can do its thing and show me an
> options dialog. This would help alleviate clutter in my context menu.

AFAIK, no. You have to make a Context menu handler.

> 2. The simple introductory example at the top (with the asterisk (*))
> inserts the menu item when right clicking of any explorer file. It
> does not insert the menu when clicking over a folder or

For folders, add it here :
HKEY_CLASSES_ROOT\Directory
Or
HKEY..CR\Folder

if you want the context menu on both: Directory+Files then you can :
1) add it to * and Directory or Folder
2) add it to HKCR\AllFilesystemObjects

If you want to add the context menu to AllFileSystemObjects then add it in :
HKEY_CLASSES_ROOT\AllFilesystemObjects\shellex\ContextMenuHandlers
OR
create a shell key under AlFileSystemObjects then make the required keys.

> over empty
> space in explorer. Is there a simple way to hook the menu in for
> either of those cases?

Then add the keys to :
HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers

shell key doesn't work here.. :(

--
â?? Ayush
-------------
Search - www.Google.com | Wikipedia - http://en.wikipedia.org
Snip your long urls - http://snipurl.com/
-------------