I am trying to figure out how to cause a Menu Strip item to open the active Windows accounts default browser to their homepage. I have tried Process.Start("about:blank") and for some reason this always opens Internet Explorer's about:blank page. (I have Google Chrome as my default browser with http://www.duckduckgo.com as its homepage on Windows 7 Pro.)
I know I can specify any URL to open the default browser, but how to get their selected homepage to open? I have found some articles based in C# that required looking into registry entries as to finding their chosen homepage per each browser. Would the process be the same/similar in VB.Net 2017 and how would I go about doing so? This is using VB.Net 2017 Community Edition and the project is a Windows.Forms desktop application.
The only way I found is to manually query the registry about the default command to handle the http protocol.
The first line of this code will return something like
"C:\Program Files\Your Browser\browser.exe" -osint -url "%1", so you want to replace%1by your landing page.Then, if you want to use
Process.Startwith command line arguments, the first parameter will be the command and the second one the arguments. Thus, we need to split the registry string between the command and the argument list. The regex will do this job.I omited null checks and regex success for clarity.