Hi. I'm usually a new member here. I know there is a way to get if Firefox is your default browser or other browsers..
Its not http for getting the default browser. but it's the ".htm" extension you should check.
How did I find out?
I've tested changing "FirefoxHTML" into another string that is not for firefox then I started running firefox.
When it opens, it says that firefox is not your default browser.
So here is the code that I wrote:
So if your default browser is firefox, then it will appear the code belowCode:Public Function GetDefaultBrowser() As String Dim GetLink As String = My.Computer.Registry.GetValue("HKEY_CLASSES_ROOT\.htm", "", "") 'Gets the default value of the .htm extension for locating the default browser's parameter Dim Result As String = My.Computer.Registry.GetValue("HKEY_CLASSES_ROOT\" + GetLink + "\shell\open\command", "", "") 'Gets the shell command of the default browser to be returned. Return Result.ToString End Function
If you want to browse something, then just replace "%1" to the web you like.Code:"C:\Program Files (x86)\Mozilla Firefox\firefox.exe" -requestPending -osint -url "%1"
Example:
I hope this helped you [gja].Code:Dim WebLocation As String = GetDefaultBrowser.Replace("%1", "vbforums.com") Shell(WebLocation) 'Replace vbforums.com to any location in the web to be launched by the default browser.





Reply With Quote