1

Now I'm trying to implement a Browser Helper Object on IE11. In the BHO I would like to hook WH_CALLWNDPROC to detect editing to Address bar but I have not got it. When I call the SetWindowsHookEx function in BHO SetSite, the BHO dll is injected to IE Child Process but is not injected to IE Parent Process. So I have not detected the editing.

Do you know how to get it?

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);
}

Best Regards, Kamakuran

Kamakuran
  • 33
  • 5
  • 1
    Short from getting the basics of hooking wrong (DLL required), UIPI will stop you from hooking a process that runs at a higher integrity level. Keep in mind that your BHO runs in another process that is sandboxed by the Enhanced Protected Mode feature. No real path ahead here, you can't make this work. – Hans Passant Dec 15 '14 at 10:56
  • 1
    More often than not, when someone tries to monitor certain input controls, they are rather interested in the events resulting from certain events. In your particular scenario, do you really need to be notified whenever the address bar changes, or would the [DWebBrowserEvents2](http://msdn.microsoft.com/en-us/library/aa768283.aspx) suffice (`BeforeNavigate2`, `NavigateComplete2`). – IInspectable Dec 15 '14 at 11:38
  • Monitoring the address bar sounds a lot like what malicious applications do. I bet that IE11 prevents this on purpose. – sashoalm Dec 15 '14 at 14:51
  • Take a look here: http://stackoverflow.com/questions/21364178/add-browser-action-button-in-internet-explorer-bho/21540353#21540353 You will find some infos about hooking the main IE process via a broker process. – manuell Dec 27 '14 at 15:50

0 Answers0