mshtml

IWebBrowser: How to specify the encoding when loading html from a stream?

Using the concepts from the sample code provided by Microsoft for loading HTML content into an IWebBrowser from an IStream using the web browser's IPersistStreamInit interface: pseudocode: void LoadWebBrowserFromStream(IWebBrowser webBrowser, IStream stream) { IPersistStreamInit persist = webBrowser.Document as IPersistStreamInit; ...

How to make TWebBrowser ignore accelerator chars of others controls?

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...

There is another way to load MSHTML documents without use Application.ProcessMessages?

There is another way to load MSHTML documents without use Application.ProcessMessages? To load a document into a IHTMLDocument I need to do this: while Doc.readyState <> 'complete' do Application.ProcessMessages; I want not to process all the message queue during the loading, because I would be changing my application flow, in ...

Why does this window object not have the eval function?

I ran into an interesting (?) problem in the YUI rich edit demo on IE. When looking at the window object for the content editable frame used as the browser I see that the eval function is undefined (by running the following). javascript:alert(document.getElementById("editor_editor").contentWindow.eval) This only happens on IE (I check...

Do the new NoPIA and Type Equivalence features in C#/.NET 4.0 mean Microsoft.mshtml.dll is no longer needed

I'm maintaining a WPF based application which contains a WinForms based WebBrowser control that based on the IE web browser control. When we deploy, we have had to also supply Microsoft.mshtml.dll and do some custom configuration stuff for our ClickOnce publishing process as well in order to get things to work. I'm curious that with the...

MIDL2035 error: Constant expression expected for mshtml.idl for IFilter

Hi I am trying to execute the Filter sample which comes with Windows Search 3.x sdk. I am getting below MIDL2035 errors, saying Constant expression expected. Thanks for the help. Mitech. ...

Setting HTML Text Element value

In a C# WPF program I'am trying to set the value of a HTML Text element which is defined: <input name="tbBName" type="text" id="tbBName" tabindex="1" /> I tried the following: mshtml.HTMLDocument doc = (mshtml.HTMLDocument)webBrowser1.Document; mshtml.HTMLInputTextElement tbName = (mshtml.HTMLInputTextElement)doc.getElementsByName("t...

How can I call a method on a custom object created in JavaScript using C#?

I have a WebBrowser control. I have added some JavaScript into the head tag and I can see it is working as expected by adding an alert. Inside of this js I am creating a function and adding some members to it's prototype like so: function test() { } test.prototype.run = function() { alert('success!') } function createTest() { ...

Programatically rotate tiff image (or pdf)

Does anyone know a way of rotating an image (jpg or gif) in a TWebBrowser control (using Delphi) Update The file would be local. Update 2 So I guess the question should be how do I rotate an image or pdf. ...

BHO memory leak

I've written a BHO based on this tutorial: http://www.codeproject.com/KB/cs/Attach_BHO_with_C_.aspx My GetSite and SetSite are identical to the tutorials listing. I am adding/removing an OnDocumentComplete handler and assigning SHDocVW.WebBrowser webBrowser inside the IObjectWithSite SetSite function for debugging purposes I've removed...

WebBrowser Control in 32bit app Launches 64bit Internet Explorer on window.open() call

I have a 32bit application running on Windows 7 64bit. The application (written in C++) hosts a WebBrowser control. When the WebBrowser control is asked to popup a new windows (through a javascript window.open() call), it launches a new Internet Explorer process. In particular, this new IE process is a 64bit IE process. Since web pag...

C#: How to set the value of an mshtml.HTMLInputFileElement

I am currently working on a project that needs to be able to set the value of an input element of type "file" in an HTML document using mshtml.HTMLInputFileElement. I am having a great deal of difficulty doing this. First I tried this: IHTMLInputFileElement element = (IHTMLInputFileElement)args[0]; string filename element.value = new...

How to get font size of currently selected text in WebBrowser control

Is there any way to get the font size of the currently selected text in the Microsoft WebBrowser control (MSHTML)? I am aware of IHTMLDocument2::queryCommandState("FontSize", ...), but this method only returns a value between 1 and 7, for the outdated font sizes "xx-small" to "xx-large". For font sizes like "10pt" or "14px", no useful v...

Using HTMLDocument to manipulate HTML and show it in WebBrowser-control

Hi, I am trying to manipulate a requested document in the WPF WebBrowser-control. I already managed it to invoke JavaScript on loaded document, but I am not able to change the shown HTML-code in the control itself. My (very simplified) code in the OnNavigating-Handler looks like this: mshtml.HTMLDocument doc = (mshtml.HTMLDocument)...

mshtml 8.0 and Microsoft.mshtml 7.0

Hi, I'm a little confuse and maybe you can help me. I've the mshtml.dll (version 8.0) and the Microsoft.mshtml.dll (version 7.0) If I go to add a reference to my WPF project and try to add the mshtml.dll, it tells me that the reference has to be a valid assembly or com component. And that's right as I know I have to add a reference to ...

Create Protected Nodes when using webbrowser / IHTMLDocument2 in c#

Hey all, I am working a project in C# that allows the user to edit a webpage. It is using mshtml for the editor. I'm looking for a way to protect a couple of table cells. Basically they can edit everything except what is in the specified table cell. The user does not have access to the source code of the webBrowser. Thanks for any ins...

How to create a direct3d texture of a web page rendered by MSHTML in C++ ?

Hello all, I have integrated a web page inside my native C++ Application through MSHTML (Microsoft Rendering engine of IE). What I want to do now is to generate a LPDIRECT3DTEXTURE9 (Direct3d texture) of the displayed web page. Is it possible ? Do you know how to ? Thanks in advance for all your answers. ...

mshtml.dll version is 8.0 and Microsoft.mshtml is 7.0

Hi, I'm a little confuse and maybe you can help me. I've the mshtml.dll (version 8.0) and the Microsoft.mshtml.dll (version 7.0) If I go to add a reference to my WPF project and try to add the mshtml.dll, it tells me that the reference has to be a valid assembly or com component. And that's right as I know I have to add a reference to ...

Watin's IEElement.ClickOnElement throwing COMException when clicked on an anchor tag and page is set to popup a confirm dialog on OnBeforeUnload event

I'm autmating the UI of our web application using Watin. One of the page (X) has got an anchor tag which navigates to another page (Y). Page X pops up an confirm dialog on "OnBeforeUnload" event. So when someone manually clicks on the anchor tag, the confirm dialog pops up and when user clicks on the ok button the navigation continues. I...

Microsoft.mshtml / mshtml.dll versioning and reference issues

Hi, I'm using .NET 4, trying to add a reference to mshtml, and I want to have all the capabilities depending on the version the client has installed. If I add a reference to the COM component called 'Microsoft HTML Object Library', the reference is labelled "MSHTML" and the path points to an assembly in the GAC called 'Microsoft.html' ...