Shell Extension Context Menu Sample

CodeGuru content and product recommendations are editorially independent. We may make money when you click on links to our partners. Learn More.

Environment: VC5.0, Win95/98/NT

An Explorer context menu is the menu that pops up when you right-click on
a file or folder form within Explorer or My Computer or any other standard file
browse dialog.  You see them for apps like WinZip, virus scanners, image viewers,
etc.  But, there is surprisingly little documentation on them, and the examples
that are out there are mostly pretty poor.

I’ve taken the basic SHELLEX sample from the MSDN and filled in the missing
parts, added multi-threading and a progress dialog and packaged it for you to use
for your own applications.

The source package includes a lengthy readme file that explains the inner workings of the
code, how to add your own changes, how to debug it and the things you’ll need to
know if you want to distribute the final product.  Please read the notes on
running and debugging – shell extensions are not normal apps, you’ll need to
do some special setup steps before you can run or debug them.

A friendly warning:

If you’ve never seen a COM DLL before, this code may be confusing.  But trust me,
there are only a few sections that you will have to modify in order to add your own code.


I don’t know anything about the other kinds of extensions that are possible : property pages,
namespace extensions, etc.  Don’t ask.

Have fun!

This is distributed as a VC5 project.  I don’t know if it will work on VC4 or VC6.


Download source – 33 Kb

More by Author

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends & analysis

Must Read