I've got an instance of InternetExplorer on a new thread running in my app, and, using IE.HWND I am trying to get the handle of the IE window including all the chrome, however, IE.HWND only gives me the handle for the document itself and the status bar for some reason.
I've tried this:
[DllImport("user32.dll", ExactSpelling = true, CharSet = CharSet.Auto)]
public static extern IntPtr GetWindow(IntPtr hWnd, int uCmd);
public const int GW_HWNDFIRST = 0;
hwnd = (IntPtr)GetWindow(hwnd, GW_HWNDFIRST);
But it's returning a IntPtr with the value of 0.
Anyone now how to go up enough to get the actual full window - it's classname is "IEFrame" - and i've tried using that to get it, but it did the same, and even if it did work, it doesn't garauntee it will get the right instance of IE (i don't want to search by WindowTitle/Name)
public static extern IntPtr FindWindow(string sClassName, string sWindowName);
hwnd = FindWindow("IEFrame", string.Empty);
Is there another Windows API function I can import?