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. How to : Hook IE document message...

How to : Hook IE document message...

Scheduled Pinned Locked Moved COM
tutorialquestioncomdebugging
1 Posts 1 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.
  • L Offline
    L Offline
    Lost User
    wrote on last edited by
    #1

    Hi. I'm Soohyun Bae. Now I'd like to hook some messages invoked by IE document, for example, mousemove, mouse click, key down... Now, I could receive these messages by connecting my class derived from IDispatch to IE document. CImpDispatch* m_pEvents; m_pEvents = new CImpDispatch((IOleInPlaceFrame *)this); hr = pCPC->FindConnectionPoint( DIID_HTMLDocumentEvents, &m_pConnectionPoint ); hr = m_pConnectionPoint->Advise(m_pEvents, m_dwConnectCookie ); ... and CImpDispatch... STDMETHODIMP CImpIDispatch::Invoke( DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS* pDispParams, VARIANT* pVarResult, EXCEPINFO* pExcepInfo, UINT* puArgErr) { IHTMLEventObj *pEvtObj = NULL; long x; HRESULT hr; if (dispIdMember == DISPID_HTMLDOCUMENTEVENTS_ONKEYDOWN ) { hr = m_pWindow->get_event(&pEvtObj); if (hr == S_OK) { pEvtObj->get_keyCode(&x); // A key hook if (x==65) { Trace("_HOOK: A key pressed"); x=0; // Point 1 hr = pEvtObj->put_keyCode(x); // Point 2 if (hr==S_OK) { pEvtObj->get_keyCode(&x); } } } } return S_OK; } I could take reference code in www.microsoft.com/Mind/1297/hookIE.htm (really good...) ----------------------------------------------------------- My Point is : I hope to prevent resending specified message to IE. I have thought that two points 1 and 2 could make so. But, ... couldn't... How can I prevent resending ?

    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