FAQ: Automatically display the toolbar when starting IE

xiaoxiao2021-03-06  54

Q================================================ Eagleboost, hello! I saw the article you wrote about the IE programming in 9CBS, you can see that you are very familiar with this. I have a problem now to ask you, that is, I have made a thing similar to the Google tool bar, have been registered, but I have to go to the right mookmill hook to display it. I want it to register, IE will display it by default, I don't know where to modify the registry? Trouble you answer, thank you very much! 2004-09-22 answer ========================================= Your problem comparison common. Standards, and the best way to implement a Browser Helper Object (Bho) in your tool bar, such as the cshowbarobj below, and call the IWebBrowSer2's showbrowserbar function in the IObjectwithSite :: SetSite method to display your toolbar. . The example in the VC is as follows:

STDMETHODIMP CShowBarObj :: SetSite (IUnknown * pUnkSite) {if (! NULL = pUnkSite) {IWebBrowser2 * pBrowser = NULL; // Ensure that our site is an browser window HRESULT hr = pUnkSite-> QueryInterface (IID_IWebBrowser2, (void **) & PBROWSER); if (succeededed (hr)) {// Display the Band Object (The Search Bar in this case) Variant VTBANDGUID, VTSHOW; VTBANDGUID.VT = Vt_BSTR; // Change the CLSID here to your Tools CLSID VTBANDGUID .bstrVal = SysAllocString (OLESTR ( "{30D02401-6A81-11D0-8274-00C04FD5AE38}")); vtShow.vt = VT_BOOL; vtShow.boolVal = true; pBrowser-> ShowBrowserBar (& vtBandGUID, & vtShow, 0); SysFreeString (vtBandGUID .bstrval); PBROWSER-> Release ();}} Return S_OK;} Reference address: FAQ: Automatic display toolbar when starting IE

转载请注明原文地址:https://www.9cbs.com/read-114118.html

New Post(0)