This tutorial explains how to add a menu item that runs a Microsoft® Win32® application or that runs a script to the Tools menu or Help menu in Microsoft® Internet Explorer. If you also want to create a toolbar button for the Win32 application or script, see the Adding Toolbar Buttons tutorial.
Developers who want to add items to the Tools menu in Internet Explorer must be familiar with the registry.
This feature is only available in Internet Explorer 5 and later.
The steps in this section must be followed when adding any items to the Tools menu in Internet Explorer. If any steps (that aren't optional) are omitted, the item will not be displayed in the Tools menu.
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".
Note This tutorial describes how to add a menu item for all users. You can substitute HKEY_CURRENT_USER for HKEY_LOCAL_MACHINE in the steps below for settings that you want to make per user.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions
The result should look like:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\<Your GUID>
<Your GUID> is the valid GUID that you created in step 1.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions
The result should look like:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\<Your GUID>\MenuCustomize
Set the value of MenuCustomize to "help" to have the menu item appear in the Help menu. If this string value doesn't exist or is set to something other than "help", the menu item will appear in the Tools menu.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\<Your GUID>
The result should look like:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\<Your GUID>\CLSID
Set the value of CLSID equal to {1FBA04EE-3024-11d2-8F1F-0000F87ABD16}.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\<Your GUID>
The result should look like:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\<Your GUID>\MenuText
Set the value of MenuText to the text you want to be displayed in the Tools menu. This text does not support any underlining of characters for shortcut keys, because there is no way to prevent conflicts.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\<Your GUID>
The result should look like:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\<Your GUID>\MenuStatusBar
Set the value of MenuStatusBar to the text you want displayed in the status bar when the menu item is highlighted. This text should describe what the script associated with this menu item will do.
After completing the initial step of creating a new registry key, you will add values under the key. The values you will need and the other steps to follow depend on what the menu item is going to run. The following list contains links to the sections with the steps required to complete the addition of the menu item.
The following steps are required to complete the creation of an item in the Tools menu that implements a COM object. If any steps (that aren't optional) are omitted, the item will not be displayed in the Tools menu.
Note This tutorial describes how to add a menu item for all users. You can substitute HKEY_CURRENT_USER for HKEY_LOCAL_MACHINE in the steps below for settings that you want to make per user.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\<Your GUID>
The result should look like:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\<Your GUID>\ClsidExtension
Set the value of ClsidExtension equal to the GUID of the COM object.
In addition to the previous steps, the COM object must implement IOleCommandTarget.
If your COM object needs to access the DHTML Object Model of the page that Internet Explorer is looking at, you must implement IObjectWithSite.
The implementations of IOleCommandTarget's methods are standard, except for IOleCommandTarget::Exec. The COM object's IOleCommandTarget::Exec method is called with nCmdID=0 if the toolbar button or menu item is clicked. This difference allows developers to provide different behaviors for the toolbar button and the menu item.
When IObjectWithSite is implemented, Internet Explorer will call IObjectWithSite::SetSite and pass it a pointer to IShellBrowser.
The following steps are required to complete the creation of an item in the Tools menu that runs a script. If any steps (that aren't optional) are omitted, the item will not be displayed in the Tools menu.
Note This tutorial describes how to add a menu item for all users. You can substitute HKEY_CURRENT_USER for HKEY_LOCAL_MACHINE in the steps below for settings that you want to make per user.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\<Your GUID>
The result should look like:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\<Your GUID>\Script
Set the value of Script to the full path of the script to be run.
To add a toolbar button with the same functionality, see Scripts in the Adding Toolbar Buttons tutorial.
The following steps are required to complete the creation of an item in the Tools menu that runs an .exe file. If any steps (that aren't optional) are omitted, the item will not be displayed in the Tools menu.
Note This tutorial describes how to add a menu item for all users. You can substitute HKEY_CURRENT_USER for HKEY_LOCAL_MACHINE in the steps below for settings that you want to make per user.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\<Your GUID>
The result should look like:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\<Your GUID>\Exec
Set the value of Exec to the full path of the .exe file to be run.
To add a toolbar button with the same functionality, see Executable Files in the Adding Toolbar Buttons tutorial.
The following lists contain links to topics related to adding menu items to the Tools menu.
Overviews
Tutorials