简体   繁体   English

如何使用IWebBrowserApp com界面处理Internet Explorer中的多个选项卡?

[英]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.

相关问题 跨多个选项卡同步Internet Explorer工具栏(带对象) - Syncing Internet Explorer toolbar (band object) across multiple tabs 如何获取Internet Explorer和Firefox选项卡的内存详细信息? - How to get memory details of internet explorer and Firefox tabs? 如何使用每个选项卡的PID获取Internet Explorer选项卡的URL? - How to get the URL of the Internet explorer tabs with PID of each tab? 如何使用 Selenium Webdriver 和 Internet Explorer 10 处理 Windows 身份验证? - How to handle Windows Authentication with Selenium Webdriver and Internet Explorer 10? 如何在.net中获取对Internet Explorer窗口句柄的引用 - How to get a reference to Internet Explorer's window handle in .net Internet Explorer 7+附加控件选项卡 - Internet Explorer 7+ Addon to control tabs C#-获取Internet Explorer选项卡的索引 - C# - Get index of Internet Explorer tabs 打开其中有3个选项卡的Internet Explorer Windows - Opening an Internet Explorer Windows with Exactly 3 Tabs in it 在WPF应用程序中嵌入Internet Explorer COM对象 - Embedding Internet Explorer COM Object in a WPF Application 如何在不切换标签的情况下处理 Selenium 中的多个标签 - How to handle multiple tabs in Selenium without switching tabs
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM