现在我试图在IE11上实现浏览器帮助程序对象。 在BHO我想挂钩WH_CALLWNDPROC来检测编辑到地址栏但我还没有。当我在BHO SetSite中调用SetWindowsHookEx函数时,BHO dll被注入到IE子进程中,但不会被注入到IE父进程中。所以我没有检测到编辑。
你知道怎么做吗?
MyBHO.cpp
STDMETHODIMP CHelloWorldBHO::SetSite(IUnknown* pUnkSite) { --- snip --- HWND hwnd; if (pUnkSite != NULL) { pUnkSite->QueryInterface(IID_IWebBrowser2, (void**)&m_spWebBrowser); if (SUCCEEDED(m_spWebBrowser->get_HWND((LONG_PTR*)&hwnd))) { m_hHook = SetWindowsHookEx(WH_CALLWNDPROC, BHO_AddressEditProcedure, hInstanceDll, GetWindowThreadProcessId(hwnd, NULL)); if (!m_hHook) { --- snip --- } } else { m_spWebBrowser.Release(); } return IObjectWithSiteImpl::SetSite(pUnkSite); }
最诚挚的问候, Kamakuran