2

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);
Jack
  • 186
  • 1
  • 11
  • This may be related to IE itself. Vista has version 7. Which version did you have on XP ? – Timores Feb 26 '10 at 21:18
  • And which version of IE are you using on Vista ? – Timores Feb 26 '10 at 21:33
  • It is IE 7 on XP and IE 8 on Vista. I will try it with IE 8 on XP to see if it makes a difference. – Jack Mar 01 '10 at 15:38
  • I installed IE 8 on my XP machine and it works fine. So this is definitely an XP vs Vista issue. – Jack Mar 01 '10 at 17:34
  • For now I have just set the Flags for NewTab. At least I can keep them all in one window. It seems that there is no Flag for current tab as that is the default behavior in XP. The default behavior was changed to new window in Windows vista but a CurrentTab flag was never added. – Jack Jun 30 '10 at 21:42

2 Answers2

1

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.

Payton Byrd
  • 956
  • 1
  • 12
  • 27
1

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.

Rob
  • 45,296
  • 24
  • 122
  • 150