I'm trying to launch a browser window when a user makes a particular selection in my app. I've found code that does this by searching this site. The interesting part is that even though I have Firefox set as my default browser, it always returns IE and thus my code opens an IE window. I'd prefer not to have that happen. I've checked keys in the registry for HTTP and HTTPS and they're set to Firefox. Firefox says it's the default browser. Now I've noticed that if I search for something from the start menu and it wants to go to the internet for results, it also opens an IE window instead of taking me to a new tab in Firefox. Looking for more places to look.
Code to return the default browser:
//set the registry key we want to open
regKey = Registry.ClassesRoot.OpenSubKey("HTTP\\shell\\open\\command", false);
//get rid of the enclosing quotes
name = regKey.GetValue(null).ToString().ToLower().Replace("" + (char)34, "");
// Remove any command line arguments...
if (!name.EndsWith("exe"))
// Remove anything after the .exe...
name = name.Substring(0, name.LastIndexOf(".exe") + 4);
Then this to launch the application:
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo.FileName = name;
startInfo.Arguments = @"myURL";
Process.Start(startInfo);