How to use Shell Extensions class from Eduardo Morcillo

J

James Maeding

I was looking for the easiest way to add an item to explorer's right click menus, and I found what looks to be a
goldmine.
There is a vb.net project available on:
http://www.mvps.org/emorcillo/en/code/shell/shellextensions.shtml

that encapsulates the ugly stuff and gives an easy way to make the dll explorer will look for as the extension handler.
Only problem is, I don't see how it "runs". All the other progs to do shell extensions are exe's, they run and set up
registry entries to get explorer informed that the handler (dll) is to be run whan a given file extension is
right-clicked.

the website says "The code includes a library with base classes from which the extensions classes inherits. The base
classes contains the code to register the extensions automatically (with the help of two custom attributes) when the
extension library is registered for COM"

then says:
ExtensionFileTypesAttribute
This attribute is used to set the file types for which an extension has to be registered. To register a extension for
several file types, separate the file types with a comma:

<ExtensionFileTypes("mp3file,avifile,soundrec,mpegfile")>

I know how to register a dll, but have never done so with attributes. Can anyone make sense of how to get things set up
once I make the project?

I keep wondering if someone has written a prog that allows you to add right click options, and specify what to do with
the files with a command line operation. Its easy to write a prog that takes command line params, but hooking it up so
explorer feeds it the filenames is quite the process it seems.
 
C

Chris Dunaway

James said:
that encapsulates the ugly stuff and gives an easy way to make the dll explorer will look for as the extension handler.
Only problem is, I don't see how it "runs". All the other progs to do shell extensions are exe's, they run and set up
registry entries to get explorer informed that the handler (dll) is to be run whan a given file extension is
right-clicked.
<ExtensionFileTypes("mp3file,avifile,soundrec,mpegfile")>

I know how to register a dll, but have never done so with attributes. Can anyone make sense of how to get things set up
once I make the project?
From my brief reading of the site, it would seem that you need to
create a COM class that inherits from the appropriate base class in the
library. Then apply the ExtensionFileTypes attribute to indicate which
file types the extension works with. After that, I think you just need
to register the resulting .dll like you would any other and it should
work.

I compiled the mp3contextmenu example and once registered, I could
right click on an .mp3 file to create a playlist.

Good luck

Chris
 

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