Explorer in IE explore the Add toolbar button (2)

Source: Internet
Author: User
Tags object model
Add Details
In the initial steps we created the registry keys, and now we need to add the key values below them. The key values you need to add and the other steps that follow are determined by the actions that the toolbar button will perform. The following action by the toolbar button lists the remaining steps required to complete the button: COM object, Explorer Bar, script, executable file.
One, COM objects
The following steps are necessary to create a toolbar button that runs a COM object. If you omit any of these steps (not optional), the toolbar button is not displayed.
Note: This article describes how to add a tool bar button for all users. If you want to add a toolbar button to a single user, you can replace the HKEY_LOCAL_MACHINE in the following steps with HKEY_CURRENT_USER.
1. Register the COM object.
2. At the following location in the registry:
Hkey_local_machinesoftwaremicrosoftinternet Explorerextensions<your guid>
Creates a string value, CLSID, and results similar to the following:
Hkey_local_machinesoftwaremicrosoftinternet Explorerextensions<your Guid>clsid
Set the value of the CLSID to {1fba04ee-3024-11d2-8f1f-0000f87abd16}.
3. At the following location in the registry:
Hkey_local_machinesoftwaremicrosoftinternet Explorerextensions<your guid>
Creates a string value, clsidextension, and the result is similar to the following:
Hkey_local_machinesoftwaremicrosoftinternet Explorerextensions<your guid>clsidextension
Sets the value of the clsidextension to the GUID of the COM object.
In addition to the steps above, COM objects must also implement IOleCommandTarget.
If your COM object needs to access the DHTML object model in the page displayed by Internet Explorer, you must implement IObjectWithSite.
In addition to iolecommandtarget::exec, the implementation of the IOleCommandTarget method is standard. When the toolbar button is clicked, the COM object's IOleCommandTarget::Exec method is invoked, at which point the nCmdID value is 1; When the menu item is clicked, the CmdID value is 2. This allows developers to differentiate between the two different actions of a toolbar button and a menu item.
When IObjectWithSite is implemented, Internet Explorer invokes Iobjectwithsite::setsite and passes it a pointer to Ishellbrowser.
Second, Explorer Bar
The following steps are necessary to create a toolbar button that opens a browser bar. If you omit any of these steps (not optional), the toolbar button is not displayed.
Note: This article describes how to add a tool bar button for all users. If you want to add a toolbar button to a single user, you can replace the HKEY_LOCAL_MACHINE in the following steps with HKEY_CURRENT_USER.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.