views:

305

answers:

3

Hi, 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!

A: 

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?

Joey
A: 

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.

Alan McBee
+2  A: 

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;
}
Mladen Jankovic
how to not to show the button by default? I tried to change the 'true' to 'false', but is does not work.
karikari