以下内容来自MSDN:ms-help://MS.MSDNQTR.v90.chs/ieext/workshop/browser/ext/extensions.htm
This tutorial explains how to add a toolbar button to the Microsoft Internet Explorer user interface. The toolbar button can either run a Microsoft Win32 application, run a script, or open an Explorer Bar. If you also want to create a menu item for the Win32 application or script, see the Adding Menu Items tutorial.
Developers who want to add toolbar buttons to Internet Explorer must be familiar with the registry and globally unique identifiers (GUID).
This feature is only available in Internet Explorer 5 and later. Internet Explorer 4.0 allows you to add a custom Explorer Bar, but there is no method for adding a toolbar button to access your Explorer Bar.
Toolbar buttons require two sets of icons: one set with the active (color) icons and one set with the default (grayscale) icons. These icons can be stored in two .ico files or inside a resource (like a .dll or .exe file). Icons and 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". For more information about what icons are required and for tips on designing icons for Internet Explorer, see Toolbar Button Style Guide.
The steps in this section must be followed when adding any toolbar buttons to the Internet Explorer user interface. If any information is omitted, the toolbar button will not be displayed.
You can use Guidgen.exe from Microsoft Visual Studio, or Uuidgen.exe from the Microsoft Windows Software Development Kit (SDK) .
{GUID} is the valid GUID that you created in step 1.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\{GUID}\ButtonText
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\{GUID}\HotIcon
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\{GUID}\Icon
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\{GUID}\Default Visible
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\{GUID}\Lang####
For example, the key name should be Lang0411 for a Japanese implementation, since the LCID for Japanese is 0411.
To complete the setup of the custom command, you must provide details of the action that takes place when the button is clicked. The values that you need depend on what the toolbar button is going to run. The following list contains links to the sections with the steps required to complete the addition of a toolbar button.
In order to invoke a Component Object Model (COM) object from Internet Explorer, it must implement IOleCommandTarget. Only one command is supported per object; the COM object's IOleCommandTarget::Exec is always called withnCmdID=0 and with VARIANT arguments set to NULL. Additionally, the implementation of IOleCommandTarget::QueryStatus is always called withcCmds=1.
If the COM object needs to access the browser or Dynamic HTML (DHTML) Object Model of the active page, it must implement IObjectWithSite. Internet Explorer calls IObjectWithSite::SetSite with a pointer to IShellBrowser.
The following steps are required to complete the creation of a toolbar button that implements a COM object.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\{GUID}\CLSID
Set the value of CLSID equal to {1FBA04EE-3024-11d2-8F1F-0000F87ABD16} to specify theCLSID_Shell_ToolbarExtExec extension class.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\{GUID}\ClsidExtension
Set the value of ClsidExtension equal to the GUID of the COM object.
The following steps are required to complete the creation of a toolbar button that opens an Explorer Bar.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\{GUID}\CLSID
Set the value of CLSID equal to {E0DD6CAB-2D10-11D2-8F1A-0000F87ABD16} to specify theCLSID_Shell_ToolbarExtBand extension class.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\{GUID}\BandCLSID
Set the value of BandCLSID to the CLSID of the Explorer Bar to open.
The following steps are required to complete the creation of a toolbar button that runs a script.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\{GUID}\CLSID
Set the value of CLSID equal to {1FBA04EE-3024-11D2-8F1F-0000F87ABD16} to specify theCLSID_Shell_ToolbarExtExec extension class.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\{GUID}\Script
Set the value of Script to the full path of the script to run.
To add a menu item in the Tools menu with the same functionality, see the Adding Menu Items tutorial.
The following steps are required to complete the creation of a toolbar button that runs an executable file.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\{GUID}\CLSID
Set the value of CLSID equal to {1FBA04EE-3024-11D2-8F1F-0000F87ABD16} to specify theCLSID_Shell_ToolbarExtExec extension class.
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\{GUID}\Exec
Set the value of Exec to the full path of the .exe file to run.
To add an item to the Tools menu with the same functionality, see the Adding Menu Items tutorial.