IE的Add-in
http://msdn.microsoft.com/workshop/browser/ext/overview/overview.asp?frame=trueoffice的add-in
http://developer.ccidnet.com/pub/disp/Article?columnID=340&articleID=47285&pageNO=1
http://msdn.microsoft.com/workshop/browser/ext/overview/overview.asp?frame=trueoffice的add-in
http://developer.ccidnet.com/pub/disp/Article?columnID=340&articleID=47285&pageNO=1
General Steps
Adding the Details
Related Topics
Requirements and Dependencies
Note By default, custom toolbar buttons do not appear on the Internet Explorer toolbar. These buttons will appear in the left side of the Customize Toolbar dialog box.
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). For more information about what icons are required and for tips on designing icons for Internet Explorer, see Toolbar Button Style Guide.General Steps
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.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".Note This tutorial describes how to add a toolbar button for all users. If you want the toolbar button displayed for the current user only, substitute HKEY_CURRENT_USER for HKEY_LOCAL_MACHINE in the steps below.
Create a valid globally unique identifier (GUID). You can use Guidgen.exe (which ships with Microsoft Visual Studio?) or Uuidgen.exe (which ships in the Platform Software Development Kit(SDK)).
Create a new key (with the GUID as the name) in the registry under:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\ExtensionsThe 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.Optional. Create a new string value, Default Visible, in the registry under:
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>\Default Visible
To make the toolbar button to appear on the Internet Explorer toolbar by default, k 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 that will be run.To add an item to the Tools menu with the same functionality, see the Executable Files section of the Adding Menu Items tutorial.Related TopicsBrowser Extensions
Toolbar Button Style Guide
Web Accessories
Adding Menu Items
set Default Visible to "Yes", otherwise set Default Visible to "No".Note
If the user has customized the toolbar, the button will not appear on the toolbar automatically. The toolbar button will be added to the choices in the Customize Toolbar dialog box and will appear if the toolbar is reset.Create a new string value, ButtonText, in the registry under:
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>\ButtonText
Set the value of ButtonText to the label you want for the toolbar button.Create a new string value, HotIcon, in the registry under:
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>\HotIcon
Set the value of HotIcon to the full path of the .ico file that contains the three color icons.Create a new string value, Icon, in the registry under:
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>\Icon
Set the value of Icon to the full path of the .ico file that contains the three grayscale icons.Optional. Provide support for multiple native languages (like French or Japanese).
Complete the following steps to support different native languages:Determine the LCID of the native language you want to support. These values can be found in the Platform Software Development Kit(SDK).
Create a new key, Lang####, using the LCID from the previous step in place of "####" in the registry under;
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>\Lang####
For example, the key name should be Lang0411 for a Japanese implementation, since the LCID for Japanese is 0411.Adding the Details
After completing the initial step of creating a new registry key, you will add values under the key. The values that you will need and the other steps to follow 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.COM Objects
Explorer Bars
Scripts
Executable Files
COM Objects
The following steps are required to complete the creation of a toolbar button that implements a Component Object Model (COM) object. If any information (that isn't optional) is omitted, the toolbar button will not be displayed.Note This tutorial describes how to add a toolbar button for all users. If you want the toolbar button displayed for the current user only, substitute HKEY_CURRENT_USER for HKEY_LOCAL_MACHINE in the steps below.
Register the COM object.
Create a new string value, CLSID, in the registry under:
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}.Create a new string value, ClsidExtension, in the registry under:
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 Dynamic HTML (DHTML) Object Model of the page that Internet Explorer is currently displaying, 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=1 if the toolbar button is clicked and nCmdID=2 if the 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.Explorer Bars
The following steps are required to complete the creation of a toolbar button that opens an Explorer Bar. If any information (that isn't optional) is omitted, the toolbar button will not be displayed.Note This tutorial describes how to add a toolbar button for all users. If you want the toolbar button displayed for the current user only, substitute HKEY_CURRENT_USER for HKEY_LOCAL_MACHINE in the steps below.
Create a new string value, CLSID, in the registry under:
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 {E0DD6CAB-2D10-11D2-8F1A-0000F87ABD16}.Create a new string value, BandCLSID, in the registry under:
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>\BandCLSID
Set the value of BandCLSID to the CLSID of the Explorer Bar you want to open.Note All Explorer Bars have a menu item added to the View menu automatically.
Scripts
The following steps are required to complete the creation of a toolbar button that runs a script. If any information (that isn't optional) is omitted, the toolbar button will not be displayed.Note This tutorial describes how to add a toolbar button for all users. If you want the toolbar button displayed for the current user only, substitute HKEY_CURRENT_USER for HKEY_LOCAL_MACHINE in the steps below.
Create a new string value, CLSID, in the registry under:
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}.Create a new string value, Script, in the registry under:
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 that will be run.To add a menu item in the Tools menu with the same functionality, see the Scripts section of the Adding Menu Items tutorial.Executable Files
The following steps are required to complete the creation of a toolbar button that runs an .exe file. If any information (that isn't optional) is omitted, the toolbar button will not be displayed.Note This tutorial describes how to add a toolbar button for all users. If you want the toolbar button displayed for the current user only, substitute HKEY_CURRENT_USER for HKEY_LOCAL_MACHINE in the steps below.
Create a new string value, CLSID, in the registry under:
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}.Create a new string value, Exec, in the registry under:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Extensions\<Your GUID>The result should loo
Implementation Steps
Related Topics
Requirements and Dependencies
Developers who want to add menu items to the Tools menu in Internet Explorer must be familiar with the registry. Developers should also be familiar with band objects. For more information on band objects, see the Microsoft Windows® Shell API documentation in the Platform Software Development Kit (SDK). The implementation described here is valid for Internet Explorer 5 or later. To learn how to implement Explorer Bars in Internet Explorer 4.0, see the band objects documentation in the Platform Software Development Kit.Implementation Steps
The following list contains the steps for adding an Explorer Bar to Internet Explorer.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".Note
This tutorial describes how to add an Explorer Bar 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.Create a valid globally unique identifier (GUID).
Create a new key, with the GUID as the name, in the registry under:
HKEY_CLASSES_ROOT\CLSID\The result should look like:HKEY_CLASSES_ROOT\CLSID\<Your GUID>
<Your GUID> is the valid GUID that you created in step 1.The default value of the key should be set to the name of the Explorer Bar in the View menu.Create a new key, Implemented Categories, under:
HKEY_CLASSES_ROOT\CLSID\<Your GUID>The result should look like:HKEY_CLASSES_ROOT\CLSID\<Your GUID>\Implemented Categories
Create a new key using the category identifier (CATID) of the type of Explorer Bar you are creating as the name of the key. This can be one of the following values: CATID Description
{00021494-0000-0000-C000-000000000046} Defines a horizontal Explorer Bar.
{00021493-0000-0000-C000-000000000046} Defines a vertical Explorer Bar. The result should look like://for a horizontal Explorer Bar
HKEY_CLASSES_ROOT\CLSID\<Your GUID>\
Implemented Categories\{00021494-0000-0000-C000-000000000046}//for a vertical Explorer Bar
HKEY_CLASSES_ROOT\CLSID\<Your GUID>\
Implemented Categories\{00021493-0000-0000-C000-000000000046}
Create a new key, InProcServer32, under:
HKEY_CLASSES_ROOT\CLSID\<Your GUID>The result should look like:HKEY_CLASSES_ROOT\CLSID\<Your GUID>\InProcServer32
Set the default value of the key to the full path of the Shdocvw.dll for HTML pages or the .dll file of the Explorer Bar.Create a new string value, ThreadingModel, under:
HKEY_CLASSES_ROOT\CLSID\<Your GUID>\InProcServer32The result should look like:HKEY_CLASSES_ROOT\CLSID\<Your GUID>\InProcServer32\ThreadingModel
Set the value of ThreadingModel to "Apartment".Create a new key, Instance, under:
HKEY_CLASSES_ROOT\CLSID\<Your GUID>The result should look like:HKEY_CLASSES_ROOT\CLSID\<Your GUID>\Instance
Required for Explorer Bars that display an HTML page, but optional otherwise. Create a new string value, CLSID, under:
HKEY_CLASSES_ROOT\CLSID\<Your GUID>\Instance\The result should look like:HKEY_CLASSES_ROOT\CLSID\<Your GUID>\Instance\CLSID
Set the value of CLSID to {4D5C8C2A-D075-11d0-B416-00C04FB90376}.Create a new key, InitPropertyBag, under:
HKEY_CLASSES_ROOT\CLSID\<Your GUID>\InstanceThe result should look like:HKEY_CLASSES_ROOT\CLSID\<Your GUID>\Instance\InitPropertyBag
Required for Explorer Bars that display an HTML page, but optional otherwise. Create a new string value, Url, under:
HKEY_CLASSES_ROOT\CLSID\<Your GUID>\Instance\InitPropertyBagThe result should look like:HKEY_CLASSES_ROOT\CLSID\<Your GUID>\Instance\InitPropertyBag\Url
Set the value of Url to the location of the HTML file that contains the content for the Explorer Bar.Remove the following registry entries:
HKEY_CLASSES_ROOT\Component Categories\
{00021493-0000-0000-C000-000000000046}\EnumHKEY_CLASSES_ROOT\Component Categories\
{00021494-0000-0000-C000-000000000046}\Enum
Optional. Create a new key, using the GUID you created in step 1 as the name, in the registry under:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Explorer BarsHKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Explorer Bars\<Your GUID>
Optional. Create a new binary value, BarSize, under:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Explorer Bars\<Your GUID>The result should look like:HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Explorer Bars\<Your GUID>\BarSize
Set the value of BarSize to an 8-byte binary value in hexadecimal notation that sets the default size for the Explorer Bar. The value is interpreted in pixels, so the value "97 00 00 00 00 00 00 00" would be equivalent to setting the default size of the bar to 151 pixels.