Adding Entries to the Standard Context Menu

Adding Entries to the Standard Context Menu

This tutorial explains how to add an entry into the standard context menus in Windows Explorer that executes a script specified by a URL.

    * Requirements and Dependencies
    * Implementation Steps
    * Related Topics

Add an item to Windows Explorer Shell context (right-click) menu easily – How to add them ?

 

 

 Adding items to Explorer Shell context menu with Windows Explorer Shell Context Menu

 

  Add items to Windows Explorer context menu easily with Windows Explorer Shell Context Menu. This powerful .Net component for your own, custom items adding to Windows Explorer Shell context menu will add all your custom application entries to the Explorer context menu. This .Net component , C++ and Visual Basic .NET support include detailed C# / VB.NET samples, tutorials and support all you may need to add your entries to Explorer context menu :

  • Add all your items to Windows Explorer Shell context menu to be shown on any Windows OS (all OS are supported – XP, Vista, Windows x64 , etc.)
  • Add any type of items to Windows Explorer Shell context menu to be shown in any way - with custom caption and icon, as separator or sub-menu
  • Add your items to Explorer Shell context menu to be shown for all types of files or shown only for computer files of particular type (for example, only for .DOC , .MP3,.WMA,.AAC , .MPG files)
  • Add your program entries to Explorer Shell context menu, sub-menus, sub-menus of unlimited depth and add to Explorer context menu entries of all types


Windows Explorer Shell Context Menu - is a powerful .Net framework component that support all you may need to insert all your application items to the Windows Explorer Shell context menu - in a fast and a very easy way. Add your application entries to Windows Explorer Shell context menu right now – add items to context menu fast , easy and exactly as you want :

 Insert items To the Explorer Shell Context Menus easily with Windows Explorer Shell Context Menu

 

Requirements and Dependencies

Please note that this tutorial is outdated. To add your items to Windows Explorer Shell context menu , according to Microsoft guidelines, you should use Windows Explorer Shell Context Menu component (.Net, C#, VB.NET - all is supported). More information about this outdated tutorial: Developers who want to add entries to the standard context menus in Windows Explorer must be familiar with the registry. Developers should also be familiar with context menus. For more information about context menus, see the Windows Shell API documentation in the Windows Software Development Kit (SDK).

The implementation described here is valid for Microsoft Windows Explorer 4.0 or later. This feature is not available in earlier versions of Windows Explorer.
Implementation Steps

The following steps are required to add an entry into the standard context menus in Windows Explorer.

   1. Create a new key, using the text you want displayed in the context menu as the name, under:

      HKEY_CURRENT_USER\Software\Microsoft\Windows Explorer\MenuExt

      The result should look like:
      Copy Code

      HKEY_CURRENT_USER\Software\Microsoft\Windows Explorer\MenuExt\<Menu Text>

      <Menu Text> should be replaced with the text that you want displayed in the context menu. The name can include an ampersand (&) character, which will cause the character that follows to be underlined and used as a shortcut key.
   2. Set the default value of the key to the URL of the page that contains the script you want the context menu entry to execute. This script can obtain the parent window object, the screen where the context menu item was executed, from the menuArguments property of the external object.
   3. Optional. Create a binary value, Contexts, under:

      HKEY_CURRENT_USER\Software\Microsoft\Windows Explorer\MenuExt\<Menu Text>

      The result should look like:
      Copy Code

      HKEY_CURRENT_USER\Software\Microsoft\Windows Explorer\MenuExt\<Menu Text>\Contexts

      Set the value of Contexts to indicate which contexts your entry should appear in the standard context menu by using a bit mask consisting of the logical OR of the following values:
      Context    Value
      Default    0x1
      Images    0x2
      Controls    0x4
      Tables    0x8
      Text selection    0x10
      Anchor    0x20

      For example, if you want your context menu entry to appear in the default context menu and when the context is a text selection, set the value of Contexts to 0x11.
   4. Optional. Create a DWORD value, Flags, under:

      HKEY_CURRENT_USER\Software\Microsoft\Windows Explorer\MenuExt\<Menu Text>

      The result should look like:
      Copy Code

      HKEY_CURRENT_USER\Software\Microsoft\Windows Explorer\MenuExt\<Menu Text>\Flags

      Set the value of Flags to 0x1 to make the script run just as if it had been called through the showModalDialog method. Unlike the showModalDialog method, the script can access the window object of the parent window from the menuArguments property of the external object. Please note that menu items appending to Windows Explorer Shell context menu method, described here, is outdated and will not work on all new Windows operating systems, including Windows XP, Windows Vista, Windows x64 operating systems. To add your items to Windows Explorer Shell context menu , according to Microsoft guidelines, you should use Windows Explorer Shell Context Menu component (.Net, C#, VB.NET - all is supported). Strings stored inside a resource can be referenced by providing the path to the resource and reference identification in the format "path, resource_id". For example, if you wanted to use string resource 123 in Example.dll, you would use "Example.dll, 123".