ShowBrowserBar failing

  • Thread starter Thread starter Dean Hallman
  • Start date Start date
D

Dean Hallman

I'm calling ShowBrowserBar to programmatically show or hide my own IE
InfoBand (IE side panel). In my app, the BHO and IE InfoBand are separate
COM objects in a single DLL. This function fails if this particular IE side
panel hasn't previously been displayed manually (by going to
View->ExplorerBar). Works fine if I manually view the browser bar first,
then close it and then call ShowBrowserBar.

It seems ShowBrowserBar is being called before the explorer bar has been
created. But, I'm not calling ShowBrowserBar before IE has had a chance to
initialize. By the time ShowBrowserBar is called, IE has been open and
several pages visited.

How can I programmatically force the creation of the explorer bar so that
ShowBrowserBar doesn't fail if the bar has never been displayed?

Here's my code for calling ShowBrowserBar:

Thanks!
string clsid = "{8AD54A97-E2F0-41b9-A47B-9E871382C346}";

object clsObj = (object)clsid;

object ShoObj = (object)bShow;

int arg = 0;

object argObj = (object)arg;

webBrowser.ShowBrowserBar( ref clsObj, ref ShoObj, ref argObj );
 
Dean Hallman said:
I'm calling ShowBrowserBar to programmatically show or hide my own IE
InfoBand (IE side panel). In my app, the BHO and IE InfoBand are
separate COM objects in a single DLL. This function fails if this
particular IE side panel hasn't previously been displayed manually
(by going to View->ExplorerBar). Works fine if I manually view the
browser bar first, then close it and then call ShowBrowserBar.

Call ShowBrowserBar twice in a row - once to hide and again to show.
Under certain circumstances, IE gets confused as to whether the band is
already displayed or not. Calling ShowBrowserBar twice clears this
confusion.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
 
Back
Top