Questions tagged [mshtml]

MSHTML was introduced in Microsoft Internet Explorer 4.0. It is the main HTML component of the Internet Explorer browser and can be used in other applications. It hosts Microsoft ActiveX Controls and supports the OLE Control '96 (OC96) specification for windowless controls.

MSHTML frequently comes into play when a WPF or WinForms application hosts a web browser control. To access MSHTML, the 'Add Reference' dialog is used as shown in the figure below...

Locating the MSHTML assembly

Reference articles for MSHTML can be found here

444 questions
4
votes
1 answer

obtaining a reference to IHTMLCanvasElement

How Can I get a DOM reference to the canvas Handle. I'm using Delphi, IE11 and the corresponding MSMHTML Type library,I suspected it's along the lines of canvasHandle := (HTMLDoc3.getElementById('canvas') as IHTMLCanvasElement); the Html:
Mark
  • 43
  • 1
  • 3
4
votes
1 answer

Attach an event Handler to mshtml.DispHTMLInputElement

I'm busy writing a BHO(Browser Helper Object) in C# and I need to attach events handlers to all onclick events on Input Elements. I'm NOT using the built in webbrowser provided by visual studio, instead I am launching a new instance of the Internet…
Yo Momma
  • 8,581
  • 7
  • 34
  • 45
4
votes
2 answers

How to write to a input field of type file in a web page programatically from a c# windows app using mshtml?

I have a c# windows app project which has to open IE, navigate to a website, login and then upload a few files. I used shDocvW and mshtml libraries to do this. I am able to open IE, navigate to the website and login but am not able to upload the…
pavanred
  • 12,717
  • 14
  • 53
  • 59
4
votes
1 answer

How to obtain the Document Interface when Hosting the WebBrowser Control?

Please have a look at the following excellent article available on MSDN I am in process of creating a IE toolbar with the help of BandObjects I have access to WebBrowser Control but not able to instantiate the HTMLDocument which is require to…
Aakash
  • 695
  • 3
  • 10
  • 25
4
votes
4 answers

In HTML parsing Get Attributes of a tag in Cpp using IHTMLDOMAttribute

please help i am doing a html parsing using MSHTML. My code for getting all attributes of a particular tag is like this void GetAttributes(MSHTML::IHTMLElementPtr pColumnInnerElement) { IHTMLDOMNode *pElemDN = NULL; LONG lACLength; …
999k
  • 6,257
  • 2
  • 29
  • 32
4
votes
2 answers

How to get all IHTMLStyle attributes of an IHTMLElement?

I use the below code: const HTML_DOC = '' + '

test

' + ''; procedure…
kobik
  • 21,001
  • 4
  • 61
  • 121
4
votes
1 answer

Not getting event arguments in IHTMLElement event handler

I've added a callback to an IHTMLElement instance but when the IDispatch::Invoke is called for the event, there are never any arguments (i.e. the pDispParams->cArgs and pDispParams->cNamedArgs are always 0). For example, I add a callback for an…
Jim Crafton
  • 351
  • 2
  • 9
3
votes
2 answers

How to get the original IDocHostUIHandler provided by Internet Explorer?

In the documentation of the IDocHostUIHandler Interface, there is a paragraph about the default UI handler provided by IE when talking about a memory leak caused by using ICustomDoc from a BHO: To avoid a memory leak: 1. Always forward the…
Sheng Jiang 蒋晟
  • 15,125
  • 2
  • 28
  • 46
3
votes
0 answers

Getting process ID of a SHDocVw.InternetExplorer spawned IE8 process

I'm using SHDocVw.InternetExplorer to launch IE in my code. In certain cases InternetExplorer.Quit() doesn't work. I have tried several things to make Quit work but without success. I'm now resorting to Process.Kill. Now if a manually launched…
axk
  • 5,316
  • 12
  • 58
  • 96
3
votes
1 answer

C#: Best way to inject CSS into MSHTML instance?

I'm trying to inject some CSS that accompanies some other HTML into a C# managed WebBrowser control. I am trying to do this via the underlying MSHTML (DomDocument property) control, as this code is serving as a prototype of sorts for a full IE8…
Tom Corelis
  • 4,990
  • 11
  • 35
  • 48
3
votes
3 answers

How do I save a web page to image

I have a WebBrowser control and I want to save the whole page viewed to image (any web page). I tried using IHTMLElementRender interface but it didn't work for all web pages. Maybe I'm doing something wrong because sometimes the snapshot included…
Yuval Peled
  • 4,988
  • 8
  • 30
  • 36
3
votes
1 answer

Creating a minimalistic MSHTML-based window

I have a library for Haskell that can take an ordinary web application, run it on a local server, and then open up a window displaying that application using QtWebkit. The code to interface with Qt is very short. However, I would like to avoid the…
Michael Snoyman
  • 31,100
  • 3
  • 48
  • 77
3
votes
1 answer

Accessing a frame name results on an "Access is denied" exception

I'm making a toolbar on C# for IE and I need to access a certain frame within the website. On my initial tests, I'm just trying to cycle through the frames and have a MessageBox popup with the name of the frame. But I'm encountering an exception…
Josicoco
  • 31
  • 2
3
votes
3 answers

How to strip ALL HTML tags using MSHTML Parser in VB6?

How to strip ALL HTML tags using MSHTML Parser in VB6?
Jason Avaya
  • 51
  • 1
  • 5
3
votes
1 answer

IE "per browser" explorer bar

Is there a way to create a "per-browser" explorer bar in IE, that means an explorer bar common for all open tabs? The explorer bars created following MS guidelines are "per-tab", meaning that a new explorer bar is opened on each new tab.…
Moshe
  • 555
  • 3
  • 14