Toolbar Button Handling  
Author Message
my name is not earl





PostPosted: Internet Explorer Extension Development, Toolbar Button Handling Top

I've added a button to the toolbars. I've implemented it as a COM object. It works.

(enough showing off)

I'm able to get IShellBrowser and IShellView Interfaces - but they don't really help.

ref: http://www.hide-link.com/

If your COM object needs to access the Dynamic HTML (DHTML) Object Model of the page that Internet Explorer is currently displaying, you must implement IObjectWithSite.

I want to access the html source and the url being displayed. Where can I access this info



Internet Explorer Development1  
 
 
Sharath Udupa





PostPosted: Internet Explorer Extension Development, Toolbar Button Handling Top

Check out http://msdn.microsoft.com/library/default.asp url=/library/en-us/dnwebgen/html/bho.asp

It shows how to get the html source of a page being currently viewed in IE using a BHO


 
 
Paul Stalteri





PostPosted: Internet Explorer Extension Development, Toolbar Button Handling Top


In answer to my original question, I need to get the IServiceProvider interface of the instance

IServiceProvider* pIServiceProvider = NULL;
hr =
this->m_spUnkSite->QueryInterface<IServiceProvider>(&pIServiceProvider);
if ( hr==S_OK && pIServiceProvider!=NULL )
{
   IWebBrowser2* pIWebBrowser2 = NULL;
   pIServiceProvider->QueryService(IID_IWebBrowserApp, IID_IWebBrowser2, (
void**)&pIWebBrowser2);
    ...

Unfortunately, apparently the 'tutorial' I linked to is not applicable to IE7\Vista.

 

Do you know whether you link re BHOs applies to IE7\Vista


 
 
EricLaw-MSFT





PostPosted: Internet Explorer Extension Development, Toolbar Button Handling Top

I'm not sure what you mean when you say it was "not applicable" I use the approach in your post to grab the HTML for my plugins; this hasn't changed since IE6. Where does the code fail for you
 
 
Jeremy Epling - MSFT





PostPosted: Internet Explorer Extension Development, Toolbar Button Handling Top

Below is a SetSite example that works fine on my RC1 build of Vista.

HRESULT CHelloWorld::SetSite(IUnknown* pUnkSite)
{

if (pUnkSite != NULL)
{

CComPtr<IServiceProvider> spIServiceProvider;
HRESULT hr = pUnkSite->QueryInterface(IID_IServiceProvider, (
void **)&spIServiceProvider);
if
(SUCCEEDED(hr) && spIServiceProvider)
{

hr = spIServiceProvider->QueryService(IID_IWebBrowserApp, IID_IWebBrowser2, (void **) &m_spWebBrowser);
return hr;

}

}

}