Re: How difficult is to add my menu to Windows Explorer?
- From: "mayayana" <mayayaXXna@xxxxxxxxx>
- Date: Mon, 16 Feb 2009 20:26:15 -0500
You can add a basic Shell menu easily. Pick the
file type and add a few Registry keys. The following
adds Open with Notepad for all files:
HKEY_CLASSES_ROOT\*\shell\Open with Notepad\
default value: "Open with Notepad"
HKEY_CLASSES_ROOT\*\shell\Open with Notepad\Command\
default value: "notepad.exe %1"
The default value of the "Open with Notepad" key (which can
be named anything) is what displays on the menu. In other
words, this:
HKEY_CLASSES_ROOT\*\shell\blah\
default value: "Open with Notepad"
will still display "Open with Notepad"
You can also add the keys under the file type key. For
instance, you can add it under HKCR\.txt or HKCR\txtfile.
But if you use HKCR\txtfile and an editor is later installed
that takes over .txt then the HKCR\.txt key may lead to
the HKCR\AcmeTextFile key, disabling your menu.
And you can have a menu for folders by doing the same
thing under the HKCR\folder or HKCR\directory key.
By adding the line: yourEXEpath %1 your program gets
the selected file path in the command line at startup. So
you just have to check in Sub Main or Form load:
s = Command$
Then check that at startup to see if you've got a file path.
You can also add a menu item under the shellex key instead
of the shell key. Your menu item then shows lower down on
the context menu. But for that you need to write a context menu
handler shell extension. The advantages are questionable.The
main difference seems to be that you get to customize your
menu text for the specific file. If you're interested in that you
might want to look for the book V. B. Shell Programming by
J.P. Hamilton (O'Reilly). It covers all of the shell extensions
clearly. They're not hard to do from VB but I don't know of
any usable documentation about *how* to do it other than
that book.
Hello group,on
I need some pointers where to start.
I would like to add my own menu to Windows Explorer popup menu depending
the object clicked on by the user.
How difficult is it?
Can I see some examples how to do that?
Thanks,
Kathy
.
- Follow-Ups:
- References:
- Prev by Date: Re: How to embed a Manifest File?
- Next by Date: Re: How difficult is to add my menu to Windows Explorer?
- Previous by thread: How difficult is to add my menu to Windows Explorer?
- Next by thread: Re: How difficult is to add my menu to Windows Explorer?
- Index(es):
Relevant Pages
|
Loading