mshtml

Accessing JavaScript Objects from vb.net

五迷三道 提交于 2021-01-29 07:02:11
问题 I'm working on a vb.net application that interacts with a (third party provided) web app to provide additional functionality (e.g. removing menu items, pulling information from the pages, etc.). The web app is completely driven by javascript but is hosted in asp.net and is only used with Internet Explorer. I'm trying to read properties from a javascript object and execute some of it's functions. I've managed to get hold of the javascript object by getting the mshtml.HTMLDocument of the iframe

Accessing JavaScript Objects from vb.net

三世轮回 提交于 2021-01-29 06:56:20
问题 I'm working on a vb.net application that interacts with a (third party provided) web app to provide additional functionality (e.g. removing menu items, pulling information from the pages, etc.). The web app is completely driven by javascript but is hosted in asp.net and is only used with Internet Explorer. I'm trying to read properties from a javascript object and execute some of it's functions. I've managed to get hold of the javascript object by getting the mshtml.HTMLDocument of the iframe

How to make TWebBrowser ignore accelerator chars of others controls?

北慕城南 提交于 2020-08-03 03:25:11
问题 I have a TWebBrowser placed on a form with the designMode enabled. Bellow the browser I have a close button with the Caption set to 'Clos&e'. When I am editing the contents of a document inside the WebBrowser and I press the key E the button close is called. It appears that it is treating TWebBrowser like other controls that don't handle keys and/or don't accept chars (e.g. TButton). How can I solve this? Thanks in advance. 回答1: Descend from TWebBrowser, override the CN_CHAR message handler,

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

情到浓时终转凉″ 提交于 2020-02-26 18:47:52
问题 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 mode. Another button, "Cancel", turns off design mode. Pseudocode (very simplified): public void SetDesignMode(bool dm) { IHTMLDocument2 doc = webBrowser.Document as IHTMLDocument2; if (dm) doc.designMode = "On"; else doc.designMode = "Off";

WinForms problem with mshtml and ie9

天大地大妈咪最大 提交于 2020-01-24 12:23:22
问题 IE9 appears to have broken my mshtml com based WebBrower html editor in my 32-bit winforms .net 3.5 application. (It has to be set to 32-bit due to an activex USB device controller I have to use.) The bug is erratic - it doesn't happen on my system. If my customer runs IE9, and then my 32-bit application with the WebBrowser based html editor, my app hangs, no response. This did not happen with IE8. This is so screwed up I don't even know how to formulate the question. 来源: https:/

In MSHTML, what do the numbers mean? Like in IHTMLElement7?

≡放荡痞女 提交于 2020-01-16 03:10:52
问题 In MSHTML the interfaces are often numbered. The numbers are at the end of the interface names like IHTML{name}{number} . Interfaces like: IHTMLRuleStyle IHTMLRuleStyle2 ... IHTMLRuleStyle6 or IHTMLElement IHTMLElement2 ... IHTMLElement7 A list can be seen in this Microsoft page 回答1: Thanks @Jay for your comments. The numbers represent the version of MSHTML and the version numbers have an indirect relationship with the version of Internet Explorer, CSS, HTML, etc... I wish I had did this

Advising an HTML control: when should I call DispEventUnadvise?

丶灬走出姿态 提交于 2020-01-15 03:49:27
问题 I use DispEventAdvise in a BHO in order to capture onclick events of a specific checkbox. You can see the code in my previous question (although it's not that relevant). In order to be able to call DispEventUnadvise later, I keep a reference to the IHTMLElement object of the checkbox. When should I call DispEventUnadvise ? Is there a way to know when the checkbox is going away? Is it even legal to keep a reference to the IHTMLElement object? I mean, when the page is destroyed, and there's

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

a 夏天 提交于 2020-01-14 14:49:22
问题 How to strip ALL HTML tags using MSHTML Parser in VB6? 回答1: This is adapted from Code over at CodeGuru. Many Many thanks to the original author: http://www.codeguru.com/vb/vb_internet/html/article.php/c4815 Check the original source if you need to download your HTML from the web. E.g.: Set objDocument = objMSHTML.createDocumentFromUrl("http://google.com", vbNullString) I don't need to download the HTML stub from the web - I already had my stub in memory. So the original source didn't quite

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

隐身守侯 提交于 2020-01-10 04:04:06
问题 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 it as this type so that I can pull the title out, however I can't find this type in any .NET library. Will I have to create the type myself or am I just looking in the wrong place/approaching this wrong way? How can I pull the page title out of a

Tools to reduce generated HTML size

柔情痞子 提交于 2020-01-06 07:00:27
问题 I'm using google docs, and some templates we are using were created using MS-Office. The resulting HTML is fat and ugly, and the 500KB per doc limitation on google makes some cleanup mandatory. I was able to find redundant "style" attributes and move them to some CSS class, and rename the most redundant classes names to shorter ones, which makes me save about 50% of the original size. Are you aware of some existing tools/scripts/lib which could do this painful job for me, or at least help me