[英]How to handle multiple tabs in internet explorer with the IWebBrowserApp com interface?
I am using the following code (C#) based on the IWebBrowserApp com interface to find the Internet explorer window that matches the page I am trying to find, based on the title of the page. 我正在使用基于IWebBrowserApp com接口的以下代码(C#)来查找与我尝试查找的页面匹配的Internet Explorer窗口,该窗口基于页面标题。
I works fine if the page is on the first tab, but it does not work if its a later tab. 如果页面位于第一个选项卡上,我可以正常工作,但如果页面位于较高的选项卡上,则无法正常工作。 So how do I get access to the tabs in internet explorer?
那么如何访问Internet Explorer中的选项卡?
objSW = new ShellWindows();
IEnumerator ie = objSW.GetEnumerator();
while (ie.MoveNext())
{
obj = ie.Current;
app = (IWebBrowserApp)ie.Current;
System.Object docObj = app.Document;
HTMLDocumentClass hdoc = (HTMLDocumentClass)docObj;
if (hdoc.title.Contains(title)) matches.Add(app.HWND, app);
//do something
} }
抱歉,IE9或更早版本中的选项卡枚举/操作没有受支持的API。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.