Jump to content

Get HTML Document from Internet Explorer_Server

Recommended Posts


Hi All,

I just starting to learn using AutoIt.
I'm trying to get the HTML document in an embeded Internet Explorer_Server in a windows application.

Below is the code I used :

var topLevelWindow = AutoItX.WinGetHandle("[CLASS:TMainFrm]");

 if (topLevelWindow == IntPtr.Zero)
    //MessageBox.Show(string.Format("Could not find a top level window with '{0}' in its name.",
    //                              TopLevelWindowSubstring));
     return null;

IntPtr ieWindow = IntPtr.Zero;
EnumChildWindows(topLevelWindow, FindEmbeddedIEWindow, ref ieWindow);
if (ieWindow == IntPtr.Zero)
    //MessageBox.Show(string.Format("Could not find an IE window as a child of HWND 0x{0}.",
    //                              topLevelWindow.ToString("x")));
    return null;

uint htmlGetObjectMessage = RegisterWindowMessage(WMHtmlGetObject);

object documentObject;

UIntPtr sendMessageResult = UIntPtr.Zero;
SendMessageTimeout(ieWindow, htmlGetObjectMessage, UIntPtr.Zero, IntPtr.Zero,
                                   SendMessageTimeoutFlags.SMTO_NORMAL, 10000, out sendMessageResult);

Unfortunately I still unable to retrieve the HTML Document since it return me zero.
Anyone know what I did wrong here ?

Thanks in advance.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.