Article ID: 255920 - Last Review: July 15, 2004 - Revision: 2.3 How to programmatically activate a band objectThis article was previously published under Q255920 SUMMARY
The only supported way to programmatically show and hide a band object (such as an Explorer Bar, CommBand, or ToolBand) in Internet Explorer is to use the IWebBrowser2::ShowBrowserBar method.
MORE INFORMATION
In many cases, developers of band objects want to be able to automatically
display their band object when the user starts a new instance of Internet
Explorer. The best way to achieve this functionality is to use a Browser Helper Object (BHO) in conjunction with the band object. In this way, the BHO can decide whether or not to programmatically activate the band object based on registry keys or other settings persisted by the band object itself.
To build a minimal BHO that can programmatically activate a band object (the Search bar, in this example), you can create a new ATL/COM AppWizard project and add a new Internet Explorer object. Then, override IObjectWithSite::SetSite to achieve the desired functionality. The new SetSite implementation should look as follows: REFERENCES
Browser Helper Objects: The Browser the Way You Want It http://msdn.microsoft.com/library/techart/bho.htm (http://msdn.microsoft.com/library/techart/bho.htm) IWebBrowser2::ShowBrowserBar Method http://msdn.microsoft.com/workshop/browser/webbrowser/reference/IFaces/IWebBrowser2/ShowBrowserBar.asp (http://msdn.microsoft.com/workshop/browser/webbrowser/reference/IFaces/IWebBrowser2/ShowBrowserBar.asp) APPLIES TO
| Article Translations
|

Back to the top
