mshtml

WebBrowser control set Document Mode

杀马特。学长 韩版系。学妹 提交于 2019-12-02 19:56:09
问题 So I know about FEATURE_BROWSER_EMULATION, but either it isn't working for me, or it only controls the Browser Mode and not the Document Mode. I have a lot of info specific to my case below, but the general question that I think/hope should have an easy answer that applies to lots of people is: How do I get the WebBrowser control to render exactly like whatever version of IE the user has installed? I think this comes down to control over the "Document Mode" I'm trying to get the WebBrowser

About TidHttp, mshtml, ActiveX, COMObj in Firemonkey (Delphi)

眉间皱痕 提交于 2019-12-02 10:09:36
问题 I was reviewing the following interesting article, "Extract Links from HTML page using Delphi", and I tested in Firemonkey and it's very useful, however this code uses objects from Mshtml, ActiveX, and COMObj, so my questions are: do those objects above make less cross-platform for a Firemonkey project? if so, How could I get the same functionality using resources targeted for Firemonkey platform? How I can emulate a little webbrowser in firemonkey? Thanks in advance. Note : ChromiumEmbedded

.NET mshtml: How to pass a BSTR SAFEARRAY?

北慕城南 提交于 2019-12-02 06:20:33
问题 The class mshtml.HTMLDocumentClass in Microsoft.mshtml.dll assembly has a method: public virtual void write(params object[] psarray); Avoiding the real question for a moment, what code would you use to call write() ? Would you use: String html = "<html><body>Hello, world!</body></html>"; mshtml.HTMLDocumentClass doc; ... doc.write(html); or would you use: String html = "<html><body>Hello, world!</body></html>"; mshtml.HTMLDocumentClass doc; ... object[] params = new Object[1]; params[0] =

About TidHttp, mshtml, ActiveX, COMObj in Firemonkey (Delphi)

梦想与她 提交于 2019-12-02 05:02:10
I was reviewing the following interesting article, "Extract Links from HTML page using Delphi" , and I tested in Firemonkey and it's very useful, however this code uses objects from Mshtml, ActiveX, and COMObj, so my questions are: do those objects above make less cross-platform for a Firemonkey project? if so, How could I get the same functionality using resources targeted for Firemonkey platform? How I can emulate a little webbrowser in firemonkey? Thanks in advance. Note : ChromiumEmbedded object does't work for Firemonkey. Ken White MSHTML , ActiveX , and ComObj are all Windows-specific,

Parse html file using MSHTML in VBScript

怎甘沉沦 提交于 2019-12-02 02:09:23
问题 I'd like to load a string as an html file using MSHTML in VBScript and parse it. I can do this with "InternetExplorer.application" but I'd like to do it with "htmlfile" (MSHTML.HTMLDocument) The following code: Set h = CreateObject("htmlfile") h.body.innerHTML = "html goes here" gives this error: Microsoft VBScript runtime error: Object required: 'body' How do I load the html string? 回答1: Probably cheating, but seems to work: Dim oHF : Set oHF = CreateObject("HTMLFILE") oHF.write "<html><body

How to add a reference to mshtml version 9 in .NET

十年热恋 提交于 2019-12-01 04:29:19
I want to use some of the new features of mshtml.dll version 9.0 such as IHTMLCSSRule. The interop version in the following folder is version 7.0.3300.1: C:\Program Files\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml.dll The COM version in the following folder is version 9.0.8112.16441: C:\Windows\System32\mshtml.dll From what I could ascertain from the web, I should do this to create a .NET interop version 9: d:\zTemp>tlbimp mshtml.tlb /out:Microsoft.mshtml.dll /namespace:mshtml /asmversi on:9.0 This seems to have worked but generated the following warnings: TlbImp : warning

How to add a reference to mshtml version 9 in .NET

北城余情 提交于 2019-12-01 01:35:23
问题 I want to use some of the new features of mshtml.dll version 9.0 such as IHTMLCSSRule. The interop version in the following folder is version 7.0.3300.1: C:\Program Files\Microsoft.NET\Primary Interop Assemblies\Microsoft.mshtml.dll The COM version in the following folder is version 9.0.8112.16441: C:\Windows\System32\mshtml.dll From what I could ascertain from the web, I should do this to create a .NET interop version 9: d:\zTemp>tlbimp mshtml.tlb /out:Microsoft.mshtml.dll /namespace:mshtml

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

余生颓废 提交于 2019-11-30 21:24:08
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 or something similar but didn't find one. What am I supposed to pass in? After some research, I learned that these COM connection points (event handlers) are specified with DispId(0) . Callback functions are represented by instances of classes like: // These attributes may be optional, depending on the project configuration. [ComVisible(true)]

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

拥有回忆 提交于 2019-11-30 16:30:23
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 BHO. The problem is, while I can inject HTML (via mydomdocument.body.insertAdjacentHTML) and Javascript (via mydomdocument.parentWindow.execScript), it is flat-out rejecting my CSS code. If I compare the string containing the HTML I want to insert with the destination page source after injection, the MSHTML's source will literally contain everything

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

末鹿安然 提交于 2019-11-30 16:06:15
问题 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 BHO. The problem is, while I can inject HTML (via mydomdocument.body.insertAdjacentHTML) and Javascript (via mydomdocument.parentWindow.execScript), it is flat-out rejecting my CSS code. If I compare the string containing the HTML I want to insert with