Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. COM
  4. No keyboard in IWebBrowser2

No keyboard in IWebBrowser2

Scheduled Pinned Locked Moved COM
hostingquestion
2 Posts 2 Posters 3 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Angus
    wrote on last edited by
    #1

    I'm hosting the IWebBrowser2 object in a window (based on CWindowImpl). the mouse works perfectly within the browser, as does all navigation, however, I can not type within a textbox on a web page. Do I have to implement IDispach:Invoke and then redirect all keyboard events back to the browser? If so, how? The relevant section of code for hosting the browser is class CTest : public CWindowImpl>Ctest< CTest() { Create( phWnd, rcClient, _T("Browser"), WS_CHILD | WS_VSCROLL | WS_HSCROLL); } HRESULT CTest::DoAddBrowser(CComVariant t_URL) { CAxWindow wnd(this->m_hWnd); HRESULT hr = wnd.CreateControl(IDH_DEFAULTPAGE); if (SUCCEEDED(hr)) { hr = wnd.QueryControl(IID_IWebBrowser2, reinterpret_cast(&m_pIWebBrowser)); return m_pIWebBrowser->Navigate2(&t_URL,NULL,NULL,NULL,NULL); } return hr; } }; Thanks Angus

    M 1 Reply Last reply
    0
    • A Angus

      I'm hosting the IWebBrowser2 object in a window (based on CWindowImpl). the mouse works perfectly within the browser, as does all navigation, however, I can not type within a textbox on a web page. Do I have to implement IDispach:Invoke and then redirect all keyboard events back to the browser? If so, how? The relevant section of code for hosting the browser is class CTest : public CWindowImpl>Ctest< CTest() { Create( phWnd, rcClient, _T("Browser"), WS_CHILD | WS_VSCROLL | WS_HSCROLL); } HRESULT CTest::DoAddBrowser(CComVariant t_URL) { CAxWindow wnd(this->m_hWnd); HRESULT hr = wnd.CreateControl(IDH_DEFAULTPAGE); if (SUCCEEDED(hr)) { hr = wnd.QueryControl(IID_IWebBrowser2, reinterpret_cast(&m_pIWebBrowser)); return m_pIWebBrowser->Navigate2(&t_URL,NULL,NULL,NULL,NULL); } return hr; } }; Thanks Angus

      M Offline
      M Offline
      Michael Dunn
      wrote on last edited by
      #2

      Check out KB article Q196339 for a sample that hosts the web browser and shows how to get the keyboard working. --Mike-- http://home.inreach.com/mdunn/ All your base are belong to ME~!

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups