Open a new tab in IE

I use the following code to open a site in Internet Explorer

ProcessStartInfo startInfo = new ProcessStartInfo { Arguments = "http://www.example.com", FileName = "C:\\Program Files (x86)\\Internet Explorer\\iexplore.exe", RedirectStandardInput = true, UseShellExecute = false }; System.Diagnostics.Process process = System.Diagnostics.Process.Start(startInfo); 

How can I open my site in a new tab not in a new browser, given that the browser is already open?

Well,

We are creating an application in which the user can use 2 options:

1 - Use the default browser.

2- use one of the following browsers: IE, Google Chrome and Firefox (for now).

and after choosing which browser he wants to use in his application, he must choose whether he wants to open the requested page in a new window or in a new tab.

for example: if he selects IE with a new tab, the system will try to find the last page opened by the program and refresh it if it exists, and if not, it will open it in a new tab.

Regarding the IE browser, I think EricLaw -MSFT helped me find a way to open a new tab and a new window, I still need to know how I can open an open tab (already open by my program) and update in need.

I still have to do the same for Firefox and Google Chrome.

Thanks for your answers and sorry for my bad english :)

+4
source share
3 answers

You can simply use:

 Process.Start("http://www.mysite.com"); 

This will not necessarily open in IE, but in the user's browser by default as a new tab (if the browser supports it), and this is probably the user anyway;)

+9
source

If iexplore.exe does not have some parameters that you can pass, I'm not sure what you can.

All you have is to start a new IE process, so I don’t see how it can use an already running process.

Of interest, if you know that a browser is already running, why are you using this method for navigation?

+1
source

link Interop.SHDocVw.dll

  InternetExplorer ie = null; SHDocVw.ShellWindows allBrowser = new SHDocVw.ShellWindows();//gives all browsers int browserCount = allBrowser.Count - 1;//no . of browsers while (browserCount >= 0) { ie = allBrowser.Item(browserCount) as InternetExplorer; if (ie != null && ie.FullName.ToLower().Contains("iexplore.exe"))//all IE will have this name { ie.Navigate2("http://www.example.com", 0x1000);//0x1000 is the flag to open IE in new tab break; } browserCount--; } 
+1
source

All Articles