0

The following code, on Vista with Internet Explorer 7, opens two windows (the one I create, and then a second one when Navigate is called, which is the one that the file appears in). This doesn't happen in Internet Explorer 8, or on XP as far as I know. Any idea how I can stop it doing that?

     SHDocVw.InternetExplorerClass ieObject = (SHDocVw.InternetExplorerClass)this.ieObject;
     if (this.ieObject == null)
     {
        ieObject = new SHDocVw.InternetExplorerClass();
        this.ieObject = ieObject;
     }

     SHDocVw.IWebBrowser2 browserApp = (SHDocVw.IWebBrowser2)this.ieObject;
     object empty = System.Reflection.Missing.Value;
     browserApp.Visible = true;
     User32.SetForegroundWindow(new IntPtr(browserApp.HWND));
     browserApp.Navigate(filePath, ref empty, ref empty, ref empty, ref empty);
4

1 回答 1

0

您正在导航到受信任的网站吗?如果导航将跨越完整性级别,则 IE 必须为该完整性级别创建一个新进程。IE8 可以在同一个窗口中处理这个问题,因为选项卡和框架可以在不同的进程中。IE7 不支持制表符进程。

如果您的进程处于受保护模式,您将无法访问具有更高完整性级别的进程。四处走走是编写将在目标进程中运行以中继您的命令的 IE 扩展。

于 2009-10-24T22:10:15.240 回答