我正在开发一个使用 IE 显示其帮助页面的程序。我在 Visual Studio 2008 中使用 C# 编译为 .Net Framework 2.0 在 Windows XP 中一切都按预期工作。在 Vista 中,每次单击帮助按钮时,都会出现一个带有新 IE 浏览器的新窗口。有其他人看到过这个或知道如何解决这个问题吗?
这是我用来显示页面的代码。 strDefault 是我尝试加载的 html 帮助文件的位置。所有标志、postData 和 Headers 均为空。目标框架是空白的,因为这只是加载主页,我在这之后有代码来加载特定的框架。这部分工作正常。这是在 Vista 中打开新窗口的 Navigate 方法。我尝试使用一些标志选项但无济于事。
SHDocVw.InternetExplorer myIE = new SHDocVw.InternetExplorer();
string strDefault = "Frame.htm"
object Flags = new object();
object TargetFrameName = new object();
object PostData = new object();
object Headers = new object();
myIE.Navigate(strDefault, ref Flags, ref TargetFrameName, ref PostData, ref Headers);
I am working on a program that uses IE to display its help pages. I am using C# in Visual Studio 2008 compiling to .Net Framework 2.0 In Windows XP everything works as expected. In Vista every time I click on a help button I get a new window with a new IE browser. Has anyone else seen this or know how to get around this?
Here is the code I am using to display a page. strDefault is the location of the html help file I am trying to load. and all of the flags, postData, and Headers are empty. The target Frame is blank because this just loads the main page, I have code after this to load the specific frame. That part of this works fine. It is the Navigate method that is opening a new window in Vista. I have tried using some of the Flag options to no avail.
SHDocVw.InternetExplorer myIE = new SHDocVw.InternetExplorer();
string strDefault = "Frame.htm"
object Flags = new object();
object TargetFrameName = new object();
object PostData = new object();
object Headers = new object();
myIE.Navigate(strDefault, ref Flags, ref TargetFrameName, ref PostData, ref Headers);
发布评论
评论(2)
看一下 在 Windows 7 上使用 WebBrowser 控件进行就地 Shell 导航,来自 IEInternals 博客。这不是完全相同的问题(或者至少我认为不是!),但希望它能为您指出正确的答案。
Take a look at In-Place Shell Navigation with the WebBrowser Control on Windows 7 from the IEInternals blog. It's not exactly the same issue (or at least I don't think it is!), but hopefully it'll point you towards the right answer.
IE 与 Vista 操作系统的配合方式发生了根本性变化,包括新的浏览器请求发生在新进程中,而不是同一进程中。另外,你用的是IE8吗?如果是这样,每个选项卡都在同一窗口内的自己的进程中运行。
There are fundamental changes in how IE works with the OS from Vista, includng the fact that new browser requests happen in new processes instead of the same process. Also, are you using IE8? If so, each tab runs in it's own process within the same window.