Advice on how to obtain HTML from a specific instance of IE running on my desktop
Posted on 2009-07-03
I have a .NET 2.0 (C#) WinForms application running on windows desktop. From this application, I need to access the HTML (as a string) in an instance of IE (V6/V7/V8?) also running on that desktop. I have the window handle for the IE instance.
My question is - what is the best way to access (read-only) the HTML for the currently active page in IE (6/7/8?)? I am aware of two methods:
First would be to install the PIAREDIST.exe and use MSHTML. This presents the problem of installing the PIAREDIST everywhere and i dont know if its supported in IE 7/Vista or IE 8?
Second would be to build an IE add-on. This is more complicated for sure, but it may be more robust and better supported going forward.
Maybe there is another way?
I welcome all knowledgable advice on this.