mshtml

How do I save a web page to image

∥☆過路亽.° 提交于 2019-11-30 07:42:28
I have a WebBrowser control and I want to save the whole page viewed to image (any web page). I tried using IHTMLElementRender interface but it didn't work for all web pages. Maybe I'm doing something wrong because sometimes the snapshot included the scrollers and sometimes it was just partial. Do you have a working example that can save the whole web page to an image? Thanks. See http://blog.ashmind.com/index.php/2008/09/28/putting-web-snapshots-to-practical-use/ and here is the code: http://ashmind-web-ui.googlecode.com/svn/trunk/AshMind.Web.Snapshots/ It should correctly identify the size

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

好久不见. 提交于 2019-11-30 05:27:26
问题 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? 回答1: After some research, I learned that these COM connection points (event handlers) are specified with DispId(0) . Callback functions are represented by instances of

IE Extention/Plugin/Addon javascript injection in iframe and document c#

大兔子大兔子 提交于 2019-11-29 13:04:14
I am facing issue with BHO in C# ,Javascript not inject in iframe . How to get access of <iframe> body using c++/ATL/COM? question is similar like but in this above using com. i want to use C#. I have created a IE extension/Plugin/Addon To inject my Custom JavaScript on page as well as on IFrame attache with the document So I created BHO in c# . in Document complete Event private void webBrowser_DocumentComplete(object pDisp, ref object URL) { // this is main docuemnt document = (HTMLDocument)webBrowser.Document; //-------------------------------------------------------------------------------

I need to find and press a button on a webpage using VBA

前提是你 提交于 2019-11-29 10:51:35
I have written a macro that will open a webpage, find the spots I need to put the data into, and then I want the macro to hit a prefill button, then hit Ok. The page source code for the button is: <input type="text" size="30" maxlength="40" name="name" id="name"> <input type="button" value="Prefill" onclick="prefill()"> I've been searching for answers all week and I think I have a basic understanding of how this is supposed to work by running a loop to search for it, but I'm having no luck in my endeavor of actually getting this to work. Can someone show me the loop that will search my page

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

走远了吗. 提交于 2019-11-28 21:22:07
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' or one of its dependencies. Strong name validation failed. The 'Microsoft.mshtml.dll' file is distributed with the program. It is with all of the other required dlls in the same folder as the exe file. Here is the output from Fuslogvw *** Assembly Binder Log Entry (1/14

HTML - How do I know when all frames are loaded?

与世无争的帅哥 提交于 2019-11-28 09:59:44
I'm using .NET WebBrowser control. How do I know when a web page is fully loaded? I want to know when the browser is not fetching any more data. (The moment when IE writes 'Done' in its status bar...). Notes: The DocumentComplete/NavigateComplete events might occur multiple times for a web site containing multiple frames. The browser ready state doesn't solve the problem either. I have tried checking the number of frames in the frame collection and then count the number of times I get DocumentComplete event but this doesn't work either. this.WebBrowser.IsBusy doesn't work either. It is always

Rendering HTML+Javascript server-side

假如想象 提交于 2019-11-28 09:27:47
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 need a way to "host" the DOM+Javascript functionality from a browser without actually using the browser. I settled on mshtml (but open to any and all suggestions) as it seems that it should be able to to exactly that. This is an ASP.NET MVC project. I've searched far and wide and haven't seen anything conclusive. So I have this simple HTML - example

IE Extention/Plugin/Addon javascript injection in iframe and document c#

拥有回忆 提交于 2019-11-28 06:52:34
问题 I am facing issue with BHO in C# ,Javascript not inject in iframe . How to get access of <iframe> body using c++/ATL/COM? question is similar like but in this above using com. i want to use C#. 回答1: I have created a IE extension/Plugin/Addon To inject my Custom JavaScript on page as well as on IFrame attache with the document So I created BHO in c# . in Document complete Event private void webBrowser_DocumentComplete(object pDisp, ref object URL) { // this is main docuemnt document =

I need to find and press a button on a webpage using VBA

不想你离开。 提交于 2019-11-28 04:19:01
问题 I have written a macro that will open a webpage, find the spots I need to put the data into, and then I want the macro to hit a prefill button, then hit Ok. The page source code for the button is: <input type="text" size="30" maxlength="40" name="name" id="name"> <input type="button" value="Prefill" onclick="prefill()"> I've been searching for answers all week and I think I have a basic understanding of how this is supposed to work by running a loop to search for it, but I'm having no luck in

getElementById on element within an iframe

让人想犯罪 __ 提交于 2019-11-27 20:55:58
My current code works on elements outside of an iframe. How should I approach fetching elements within an iframe using getElementById? My end goal is to write text within the the <body id="tinymce"><p>...</p></body> tags. I am not using a webBrowser control - this is for an external instance of iexplore HTML Sample Code Sample foreach (InternetExplorer ie in new ShellWindowsClass()) { if (ie.LocationURL.ToString().IndexOf("intranet_site_url") != -1) { IWebBrowserApp wb = (IWebBrowserApp)ie; while (wb.Busy) { Thread.Sleep(100); } HTMLDocument document = ((HTMLDocument)wb.Document); // FETCH BY