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. C#
  4. How to get Image from Frame in mshtml.

How to get Image from Frame in mshtml.

Scheduled Pinned Locked Moved C#
tutorialquestion
2 Posts 1 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.
  • B Offline
    B Offline
    banker_kiran
    wrote on last edited by
    #1

    Hi,... My Code is like this void hooks_MouseDown(object sender, MouseHookEventArgs e) { if (e.Button == MouseButtons.Left && this.thisKeyboard.CtrlKeyDown) { IHTMLDocument2 htmlDoc = (IHTMLDocument2)((BasketToolBar)this.Tag).WebBrowser.IWebBrowser_Document; IHTMLElement el = htmlDoc.elementFromPoint(e.X, e.Y); } } Now when i am clicking on any image inside frame i am gatting IHTMLFrameElement not IHTMLImgElement. How can i get that IHTMLImgElement inside frame.

    Kiran Banker

    B 1 Reply Last reply
    0
    • B banker_kiran

      Hi,... My Code is like this void hooks_MouseDown(object sender, MouseHookEventArgs e) { if (e.Button == MouseButtons.Left && this.thisKeyboard.CtrlKeyDown) { IHTMLDocument2 htmlDoc = (IHTMLDocument2)((BasketToolBar)this.Tag).WebBrowser.IWebBrowser_Document; IHTMLElement el = htmlDoc.elementFromPoint(e.X, e.Y); } } Now when i am clicking on any image inside frame i am gatting IHTMLFrameElement not IHTMLImgElement. How can i get that IHTMLImgElement inside frame.

      Kiran Banker

      B Offline
      B Offline
      banker_kiran
      wrote on last edited by
      #2

      I am giving answer of my problem. Solution is as given below. void hooks_MouseDown(object sender, MouseHookEventArgs e) { if (e.Button == MouseButtons.Left && this.thisKeyboard.CtrlKeyDown) { IHTMLDocument2 htmlDoc = (IHTMLDocument2)((BasketToolBar)this.Tag).WebBrowser.IWebBrowser_Document; IHTMLElement el = htmlDoc.elementFromPoint(e.X, e.Y); if(el.tagName.ToLower().Contains("frame")) { HTMLFrameElement frm =(HTMLFrameElement)el; mshtml.HTMLDocument doc =(HTMLDocumen) ((SHDocVw.IWebBrowser2)frm).Document; el = doc.elementFromPoint(e.X, e.Y); } } } Kiran Banker

      Kiran Banker

      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