Programmatically adding item to explorers 'folder' context menu

  • Thread starter Thread starter john
  • Start date Start date
J

john

I would like to programmatically (from VB.NET or C#), manage items in
the windows explorer 'folder' context menu (right click menu). I need
an entry to be able to pass the folder path to my application. If I
can configure this using the .NET framework then that would be ideal,
using Win32 a close second. Modifying the registry would be ok but not
sure how safe this would be on future versions of windows. Any help
much appreciated.
 
Add an entry in the registry under HKEY_CLASSES_ROOT\Directory\shell, if you
look at what you already have there you should understand how to do it.
Basically you first add a key, and as (Default) value you set the text for
the menu, then under this key you create a new key called command, and set
the (Default) value to your program. Use "%1" as placeholder for the
argument line (the directory the user selected).
 
Comparing this registry location with the contents of the context menu
when I right click on a windows explorer folder,
HKEY_CLASSES_ROOT\Directory\shell only contains a small subset of the
contents of the explorer menu. For example, Winzip is not listed here
but does have what looks like a classid entry under shellex in various
locations in the registry (and probably has further entires
elsewhere).

Is there not some api that can be used to set this up ?
 
Back
Top