简体   繁体   中英

How to get a reference to Internet Explorer's window handle in .net

Basically I am trying to get the HWND of an instance of Internet Explorer that I have been automating in C#.

        SHDocVw.InternetExplorer IE = new SHDocVw.InternetExplorer();
        IE.AddressBar = false;
        IE.MenuBar = false;
        IE.OnQuit += IE_OnQuit;
        IE.Visible = true;
        IE.Navigate2("www.bing.com");

I would like to get a reference to it's window handle for further manipulation, however the only example of how to do this is in C++ and I am not sure how to do something similar in C#. The Example the msdn gave is here .

获得HWND非常简单:

IntPtr hwnd = (IntPtr)IE.HWND;

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM