p; */
// Get the WebBrowser''s document object
hr = m_spWebBrowser2->get_Document(&spDisp);
if (SUCCEEDED(hr))
{
CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> spHtml;
spHtml = spDisp;
// if (spHTML && DoFillIn(spHtml))>
// AddDocument(spHtml);
}
m_bDocComplete = TRUE;
// Temporarily disable keyboard hook
break;
// No parameters
/*
case DISPID_DOWNLOADBEGIN:
break;
*/
// No parameters
/*
case DISPID_DOWNLOADCOMPLETE:
break;
*/
// [0]: Enabled state - VT_BOOL
// [1]: Command identifIEr - VT_I4
//
/*
case DISPID_COMMANDSTATECHANGE:
break;
*/
// [0]: Address of cancel flag - VT_BYREF|VT_BOOL
//
/*
case DISPID_NEWWINDOW2:
break;
*/
// [0]: Document title - VT_BSTR
// [1]: An object that evaluates to the top-level or frame
// WebBrowser object corresponding to the event.; //
/*
case DISPID_TITLECHANGE:
break;
*/
// [0]: Name of property that changed - VT_BSTR
//
/*
case DISPID_PROPERTYCHANGE:
break;
&n*/
// [0]: Address of cancel flag - VT_BYREF|VT_BOOL
//
case DISPID_ONQUIT:
// Unregister the keyboard hook previously installed
// for this instance.
ManageConnection(Unadvise);
break;
default:
break;
}
return S_OK;
}
STDMETHODIMP CFiltrateIE::SetSite(IUnknown *pUnkSite)
{
if (pUnkSite != NULL)
{
// Query pUnkSite for the IWebBrowser2 interface.
m_spWebBrowser2 = pUnkSite;
if (m_spWebBrowser2)
{
m_spWebBrowser2->get_HWND((long*) &m_hwndIE);
// We''ll need the this pointer later when the keyboard
// hook will be called.
// if (!AddInstance(m_hwndIE, this, GetCurrentThreadId()))
// FormWhizError(IDS_ERROR_TOOMUCHWindows, errError);
// Connect to the browser in order to handle events.
if (!ManageConnection(Advise))
MessageBox(m_hwndIE, "AAAA", "A", MB_OK );
// FormWhizError(IDS_ERROR_SINKINGFAILED, errError);
}
}
return S_OK;
}
找到.rgs文件,加入
HKLM
{
SOFTWARE
{
Microsoft
{
Windows
{
CurrentVersion
{
Explorer
{
&nbs ''Browser Helper Objects''
{
ForceRemove {B5D4581D-ED6A-4905-A267-25BAF7BE79C1} = s ''SafeIE Utility''
}
}
}
}
}
}
}
上邊的{B5D4581D-ED6A-4905-A267-25BAF7BE79C1}在這個文件中可以找到,注意,你做的CSLID肯定不一樣。一切OK,想試一下,可以先看一下,本工程代碼