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