5

how to add new items to certain file extension context menu (to .mp3 files for instance)

I've also noticed that there is common items in all context menus across the windows, does they all share/inherit one context menu ? where is it : which one is for text

what such keys are called and how to generate them (for instance {11dbb47c-a525-400b-9e80-a54615a090c0})

also is there a good brief reference for the registry that you would recommend ?

1
  • @AndrewxXx what exactly are you trying to do? Are you looking for a registry trick to make your app show up as a handler or are you looking for an actual context menu handler? Commented Mar 29, 2015 at 3:58

2 Answers 2

9
+100
  1. Type regedit in RUN dialog box or Start Menu searchbox and press Enter. It'll open Registry Editor, now go to following keys:

    HKEY_CLASSES_ROOT* (for adding an option in All files context menu) HKEY_CLASSES_ROOT\Directory (for adding an option in folders context menu only) HKEY_CLASSES_ROOT\Drive (for adding an option in Drives context menu only) HKEY_CLASSES_ROOT\Unknown (for adding an option in unknown files context menu)

  2. Now under the above mentioned keys, you'll find "Shell" and "Shellex" keys. Both keys contain various entries, which are displayed when you right-click on a file, folder or drive. We'll use "Shell" key in this example:

    • Right-click on the "Shell" key and select "New -> Key".
    • Give it any name. Suppose we gave it name "Demo".
    • Now in right-side pane, double-click on "Default" String value and set its value to the Label which you want to display in context menu. Like if you want to add "Winamp" in context menu, then you can give it name "Open with Winamp" or similar.
    • Now create another key under this newly created key "Demo" with the name "command" and in right-side pane set value of "Default" to the path of application. For ex, for winamp you can set its value %programfiles%\Winamp\winamp.exe.

A full reference to this can be found here

Sign up to request clarification or add additional context in comments.

Comments

6

how to add new items to certain file extension context menu

How you massage the registry to create context menu item entries is already covered by this MSDN article. It is extensive and well done, no need to repeat it here.

I've also noticed that there is common items in all context menus across the windows

The majority of them are baked-in items that Explorer itself understands. There is a backdoor to add an item yourself to any file, the HKCR\* registry key is used. Use this sparingly, it is pretty annoying to users.

for instance {11dbb47c-a525-400b-9e80-a54615a090c0}

That's an example of a custom shell extension handler, you found this one back in the HKCR\Folder registry key, the key that adds items to any directory. Think of it as a plug-in that adds capabilities to Explorer that it doesn't have itself. The {guid} selects the executable file that Explorer loads to implement the item. Navigate to HKCR\Classes\CLSID\{guid} to see that file, you'll see it is implemented by c:\windows\system32\explorerframe.dll

Writing your own shell extension handler is not that easy, it requires COM coding skills in C++. A coding technique that is getting obscure. Using something like C# is technically possible but strongly discouraged by Microsoft and they won't support it. You need to write an in-process COM server that implements the IContextMenu interface. Programming guide is here.

1 Comment

Not just C++, you can code COM things in minutes, instead, with Delphi.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.