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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Access IE's document's parentWindow

Access IE's document's parentWindow

Scheduled Pinned Locked Moved C#
com
2 Posts 2 Posters 0 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.
  • Y Offline
    Y Offline
    yjoo9317
    wrote on last edited by
    #1

    hi, I am trying to capture events happening on IE (especially anchor click). I used typical IHTMLDocumentEvent2_Event method, but unfortunately this method was blocking up mouse activiteis(wheeling, selection and such) So I tried to use custmoized handler that I found at http://west-wind.com/WebLog/posts/393.aspx[^] But to do that, I need to access IE.docment.parentWindow to get IHTMLEvetObj. I am using SHDocVw.InternetExplorer not WebBrowser nor AxWebBrowser, so it did not allow to access the actual IE window to retrieve events. such as IHTMLDocument2 document = IE.document as IHTMLDocuemnt2; then, when I tried to do "document.parentWindow.@event" I reports InvalidCastException. Is there any one who has suggestions. Thanks

    M 1 Reply Last reply
    0
    • Y yjoo9317

      hi, I am trying to capture events happening on IE (especially anchor click). I used typical IHTMLDocumentEvent2_Event method, but unfortunately this method was blocking up mouse activiteis(wheeling, selection and such) So I tried to use custmoized handler that I found at http://west-wind.com/WebLog/posts/393.aspx[^] But to do that, I need to access IE.docment.parentWindow to get IHTMLEvetObj. I am using SHDocVw.InternetExplorer not WebBrowser nor AxWebBrowser, so it did not allow to access the actual IE window to retrieve events. such as IHTMLDocument2 document = IE.document as IHTMLDocuemnt2; then, when I tried to do "document.parentWindow.@event" I reports InvalidCastException. Is there any one who has suggestions. Thanks

      M Offline
      M Offline
      Mark T
      wrote on last edited by
      #2

      You can try basic a debugging technique: enter this line double d = document.parentWindow; Now, of course, this will not compile cleanly, and that is just what we want! Look at the error message and it will tell you that it can't convert from type zzz to double. (zzz will be a real type name, of course.) Now you know that this should work, so enter it: zzz z = document.parentWindow as zzz; Then try to proceed from there. One step at a time.

      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