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
6
votes
4 answers

Rendering HTML+Javascript server-side

I need to render an HTML page server-side and "extract" the raw bytes of a canvas element so I can save it to a PNG. Problem is, the canvas element is created from javascript (I'm using jquery's Flot to generate a chart, basically). So I guess I…
Dimitar Velitchkov
  • 342
  • 2
  • 4
  • 9
6
votes
2 answers

ITravelLogStg::TravelTo fails with error 0x80004002

I have these two methods to get the current travel log entry and to travel to a log entry retrieved by calling the GetTravelLogEntry method: public static ITravelLogEntry GetTravelLogEntry(WebBrowser webBrowser) { int HRESULT_OK =…
Juan
  • 15,274
  • 23
  • 105
  • 187
6
votes
2 answers

Any workaround to get text in an iFrame on another domain in a WebBrowser?

You will probably first think is not possible because of XSS restrictions. But I'm trying to access this content from an application that hosts a WebBrowser, not from javascript code in a site. I understand is not possible and should not be…
Ahmet
  • 4,310
  • 4
  • 19
  • 21
6
votes
2 answers

How to disable VML in MSHTML

I'm using the MSHTML control in edit mode. When I copy and paste stuff from word to my control the MSHTML controls strips the standard HTML and keeps VML markup that's not very well supported out there. If I unregister the VML Dll (regsvr32 -u…
Riataman
  • 61
  • 1
6
votes
1 answer

How do I add an event listener using MSHTML's addEventListener in IE9?

The MSDN documentation for addEventListener says it accepts a callback function in the form of an IDispatch * object. From C# (I'm using COM interop), Visual Studio displays the parameter type as just object. I looked for an IEventListener interface…
ide
  • 19,942
  • 5
  • 64
  • 106
6
votes
1 answer

Invalid parsing ARTICLE tag by MSHTML

I'm trying to parse HTML by MSHTML parser in Delphi 10 Seattle. It works fine , but ARTICLE tag confuse it, parsed ARTICLE element does not have innerHTML and children, although they are there. program Project1; {$APPTYPE CONSOLE} {$R…
6
votes
1 answer

How do I cast a System.Windows.Control WebBrowser.Document to an mshtml.MSHTMLDocumentClass?

I have a WebBrowser that loads inside a WPF window. I need to get the title of the web page loaded in the WebBrowser. I get the document using object doc = this._browser.Document; and I can see that it is an mshtml.MSHTMLDocument and I want to cast…
Adam
  • 1,483
  • 4
  • 21
  • 50
6
votes
2 answers

WPF WebBrowser control doesn't enter design mode when the document property is changed

I have a frustrating problem. Here's a simplified version of what I'm doing: A UserControl in c# contains a toolbar and an embedded WebBrowser object. The toolbar contains an "Edit" button, which when clicked sets the webbrowser control in design…
Ludvig A. Norin
  • 5,115
  • 7
  • 30
  • 34
6
votes
2 answers

Winform App - Webpage Interaction

Windows Form Application – Manipulating input-elements in WinForm WebBrowser Although I am familiar with HttpWebResponse/HttpWebRequest to login to a website, I was trying it now via using the mshtml library and found some weird behavior and I would…
XikiryoX
  • 1,898
  • 1
  • 12
  • 33
5
votes
3 answers

MSHTML: CreateDocumentFromString instead of CreateDocumentFromUrl

I'd like to use the MSHTML library to parse some HTML that I have in a string variable. However, I can't figure out how to do this. I can easily parse the contents of a webpage given a known URL, but not the source HTML directly. Is this…
mwolfe02
  • 23,787
  • 9
  • 91
  • 161
5
votes
0 answers

Debugging SHDocVw.InternetExplorer.Quit not closing iexplore.exe process

I think there's no definite answer so how would you approach debugging this problem?: My main app (a MicroStation plugin) launces IE using the SHDocVw.InternetExplorer COM wrapper, interacts with it, hides it when it is not used (e.g. intercepts…
axk
  • 5,316
  • 12
  • 58
  • 96
5
votes
3 answers

MSHTML tutorial

I want to learn some basics about MSHTML, like how to use IHtmlDocument and IHtmlDocument2 interfaces. I searched for quite a while, but can not find out a tutorial for beginners. Could anyone recommend something to read? EDIT: I prefer to use C#.
George2
  • 44,761
  • 110
  • 317
  • 455
5
votes
2 answers

How do I use MSHTML in VB.NET?

In the answer to question #56107, Erlend provided this sample c# code: using mshtml; ... object[] oPageText = { html }; HTMLDocument doc = new HTMLDocumentClass(); IHTMLDocument2 doc2 = (IHTMLDocument2)doc; doc2.write(oPageText); I'd like to use…
Jim Counts
  • 12,535
  • 9
  • 45
  • 63
5
votes
3 answers

Is there an event that fires when DOM is modified in MSHTML IE8?

Trying to detect if new elements are added or removed from the DOM in MSHTML. Is there such event that will fire? http://msdn.microsoft.com/en-us/library/aa741877(v=VS.85).aspx In IE9 there is…
GeorgeU
  • 7,819
  • 8
  • 26
  • 38
5
votes
2 answers

Cannot reference MSHTML properly

I need a small help building an old .NET project with VS2017 under Windows 10 (latest build). My problem is the "MSHTML" component which I need to reference somehow. Doing so via References - Add - COM - Microsoft HTML Object Library results in the…
Alex Kiselev
  • 552
  • 2
  • 7
  • 22
1
2
3
29 30