mshtml

Using different versions of MSHTML in C#

Is there any way to force a C# application to use a specific version of the MSHTML DLL? I'm trying to write an application that uses the different versions of the IE rendering engine to help web designers test their creations for backwards compatibility with IE6, IE7 etc... As far as I understand so far, the SHDOCVW DLL 'hosts' or 'run...

Get Current User Selection(IHTMLTxtRangePtr) in MSHTML

Hi, How can I get Current user selection or current cursor location in HTML document? I am useg MSHTML interfaces in MFC. Thanks. :) ...

Could not load file or assembly 'Microsoft.mshtml

Hi I have just published my asp.net web application in vs2008 THe first page displays nicely but pressing the submit button to get to the next page triggers: Could not load file or assembly 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the fi...

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 files. I am able to navigate to the website and then add a text value to the input fields(T...

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 Explorer installed on the clients PC. The problem comes in when using different versions o...

Saving webpage content using webbrowser IHTMLDocument interface

Hi, We need to save the complete web page including img, javascript, css and html using ATL webbrowser (IHTMLDocument) control, using IHTMLDocument2::get_all() method we have saved .html file but now how do we get external files such as .css, javascript and image files please help us with methods that internet explorer or firefox used...

Web Automation Using MSHTML

We want to automate a web application which is developed in asp.net. For automating this site we are planning to use the MSHTML. But before finalizing MSHTML I would like to know if there are any known limitations of MSHTML or please share list of controls which we may not be able to automate using MSHTML. Please share your experiences ...

What is the cause for inconsistency - HTMLInputElement mshtml

My requirement - I open an instance of Internet Explorer programmatically. Then, I get the HTMLDocument and look for an input field(textbox) and then set its value. HTMLDocument oDoc = new mshtml.HTMLDocumentClass(); oDoc = (HTMLDocument)oBrowser.Document; HTMLInputElement txtbox1 = (HTMLInputElement)oDoc.all.item("login",0...

Retrieve base URL path to be used in download image, CSS and javascript files from web page.

Dear All, We are downloading web page linked Images, style sheet(.css) and javascript files using web browser control (IWebbrowser2 and IHTMLDocument interface) ATL win32 application. Now for some of the web page image src= "/images/a1.jpg" are relative, so we need to append a base host address to the location and download. Do we have...

Execution time benchmarks for web automation

Are there any automation execution time related industry standards/benchmarks are available for performing different actions on web page. Like through automation; how much time can be considered as acceptable time for setting value to text box (like 1 sec for 20characters) or what range of time will be considered as acceptable for click...

Using Microsoft.MSHTML in a loop, memory leak

Hey, I am attempting to use the Microsoft.MSHTML (Version 7.0.3300.0) library to extract the body text from an HTML string. I've abstracted this functionality into a single helper method GetBody(string). When called in an infinite loop, the process eventually runs out of memory (confirmed by eyeballing Mem Usage in Task Manager). I susp...

WYSIWYG html editor query.

I am in the process of creating a simple WYSIWYG html editor to enable the users of my application to design simple html emails. At the moment I have decided to use the web browser control with mshtml to enable me to edit what is displayed. I have a tool bar which holds all of the relevant buttons (bold, underline, etc.). I need a way ...

Could not load file or assembly 'Microsoft.mshtml ... Strong name validation failed.

I made a WPF/C# program and I am using the internet control for WYSIWYG HTML editing. it is a regular Executable program. it works on most computers however some computers are giving me the following error. Could not load file or assembly 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'...

Is there any way to reference the system fonts and colors in Internet Explorer from HTML, CSS or MSHTML interfaces?

I want to do something like this: <style type="text/css"> body { font-family: dialog-font; /* Tahoma, Segoe UI or MS Sans Serif */ color: button-text; background-color: button-face; } </style> Are there any Microsoft-specific CSS values which provide this functionality? ...

How to perform Zooming with CHtmlEditCtrl in MFC

Can anyone help me to perform zooming on CHtmlEditCtrl ? I displayed my html document on CHtmlEditCtrl. Now I want my edit control to display same html document with different zooming level. I saw this feature in InternetExplorer8. Now I need to add this zooming feature to my MFC application. ...

ShowHTMLDialog and buttons style

I use the win32 ShowHTMLDialog function to display in my application an HTML popup that contains some standard HTML buttons. But for some reasons, these buttons are not rendered the same way they are in IE: they are not rounded and there is no 3D effect. Is there a way to change this programmatically and get something similar to the IE ...

Using mshtml to set contentEditable, prevent selecting div.

My current project involves working with a document editor that, for better or worse, is implemented using mshtml and setting contentEditable to true. We're certainly considering replacing this setup with something else, but for the moment assume it is not an option. In case it matters, we're doing this using VS 2008 (.Net 3.5) & C#: d...

Looking for a good HTML parser that will provide offsetHeight like values

I have a project which requires me to load an HTML document as a string, and parse it. I am trying to determine which HTML node will exceed the height of a page (8.5x11) so I can insert a ‘page-break-after’ before it. This will be done with a .NET dll I am producing. I have tried using the mshtml dom. It’s not easy to load a string valu...

How to set entire HTML in MSHTML?

How to set entire HTML in MSHTML? I am trying using this assignment: (Document as IHTMLDocument3).documentElement.innerHTML := 'abc'; but I got the error: "Target element invalid for this operation" I tried also using (Document as IHTMLDocument2).write but this form only adds html into the body section, and I neet...

How to set Content-Type of a Webbrowser Control?

Is it possible to set the Content-Type of a document in a webbrowser control? For example how can I show an XML document rendered as XML in a webbrowser control by using DocumentText? ...