How to open a url in new tab of IE8 using c# (window application) for window 7

I have created a toolbar for IE8. There is add button in the toolbar and onclick of that i want to open a url in the new tab.

I have used the following code which is working fine for window XP browser

System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo("IEXPLORE.EXE");
 startInfo.UseShellExecute = true;
 startInfo.FileName = url;
 System.Diagnostics.Process.Start(startInfo);

But for window 7 it opened the url in the new window but i want it to be opened in the new tab of same browser.

Is there any other way to do this for window 7 browser.

Waiting for ur response.

Thanks
jasbirbrarAsked:
Who is Participating?
 
Kyle AbrahamsConnect With a Mentor Senior .Net DeveloperCommented:
http://www.winvistatips.com/ie8-can-ie8-open-new-tab-click-hyperlink-t805903.html

Is your default setting to open a popup in a new window?  It could be a function of IE rather than your code.
0
 
Kyle AbrahamsSenior .Net DeveloperCommented:
http://www.dreamincode.net/forums/showtopic58684.htm

This guy was trying to do something else but the code should open up a new tab.  There also seems to be a NewWindow2 event.
0
 
roeibCommented:
try the following code:

DllImport("Shell32.dll")]

private static extern int ShellExecute(int hwnd, string lpOperation,

      string lpFile, string lpParameters,

      string lpDirectory, int nShowCmd);

public static int GoUrl(string lcUrl)

{
      string lcTPath = Path.GetTempPath();
      int lnResult = ShellExecute(0,"OPEN",lcUrl, "",lcTPath,1);

     return lnResult;
}
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
jasbirbrarAuthor Commented:
I already have tried these solutions but these are not working for window 7 browser. It opened the url in the new window instead of new tab of existing browser.
0
 
jasbirbrarAuthor Commented:
Actually I think the problem lies with the IE8 on Windows 7 only.
The default behaviour of IE8 is that for new window is that it doesn't start new Session. For new Session there already exists New Session option. But in my case it is starting new session by default.
Anything to counter that?
0
 
Kyle AbrahamsSenior .Net DeveloperCommented:
Would recommend a split between

ROIEB, Comment Id 26162766

and
Ged325, Comment ID 26189936
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.