Grant
Grant

Reputation: 11356

IE toolbar, visible by default

i have created an IE band object (toolbar) that is working well. however, when installed on a new machine it is not visible by default. Of course one can turn it on by right clicking the toolbar area and selecting it, however, i would like to know if there is a way or an option in the registry that will enable me to have the bar turned on straight after installation.

Does anyonwe know how to do this?

Thanks!

Upvotes: 2

Views: 833

Answers (3)

Mladen Janković
Mladen Janković

Reputation: 8045

You can show toolbar programatically from BHO (you can find more info about making BHOs here):

STDMETHODIMP MyBHO::SetSite(IUnknown *pUnkSite)
{
    if( /*is this the first run since BHO was installed?*/ )
    {
        CComQIPtr<IWebBrowser2, &IID_IWebBrowser2> webBrowser2 = pUnkSite; 
        if( webBrowser2 != NULL )
        {
            VARIANT vtBandGUID, vtShow, vtSize;

            vtBandGUID.vt = VT_BSTR;
            vtBandGUID.bstrVal = SysAllocString( OLESTR( "{TOOLBAR-GUID}" ) );

            vtShow.vt = VT_BOOL;
            vtShow.boolVal = true;

            vtSize.vt = VT_I2;
            vtSize.iVal = 0;

            webBrowser2->ShowBrowserBar( &vtBandGUID, &vtShow, &vtSize );
            SysFreeString( vtBandGUID.bstrVal );
        }
    }

    return S_OK;
}

Upvotes: 2

Alan McBee
Alan McBee

Reputation: 4320

Not a definitive answer, but you could run Sysinternals Process Monitor, filtering just on registry changes, and record what happens when you manually make your toolbar visible. Then make sure you do that in your installation scripts. This may get tricky if the toolbar registry entry gets assigned a GUID or ID that you don't control.

Upvotes: 0

Joey
Joey

Reputation: 354406

Just a guess but mayhaps this is the default behaviour of IE to enable the user to have a choice whatever s?he clutters the browser with?

Upvotes: 0

Related Questions