基本上,我正在尝试获取我一直在 C# 中自动化的 Internet Explorer 实例的 HWND.
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");
我想获得对它的窗口句柄的引用以进行进一步操作,但是如何做到这一点的唯一例子是在 C++ 中,我不确定如何在 C# 中做类似的事情.msdn 给出的示例是 here.
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;
这篇关于如何在 .net 中获取对 Internet Explorer 窗口句柄的引用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!