views:

113

answers:

2

How can I determine the Windows default browser (at the top of the start menu)?

I am using VB6 but can probably adapt other code no problem.

There are similar questions on Stack Overflow, but they seem to provide incorrect answers.

For instance the key HKEY_LOCAL_MACHINE\Software\Clients\StartMenuInternet\ lists both Internet Explorer and Firefox on my PC.

And getting the .html association fails for me as well, as HTML files are associated with IE but Firefox is my default browser.

Note that I don't want to actually open the browser, just get it's name.

+1  A: 

Default browsers are usually set on a per user basis. Have you tried HKEY_CURRENT_USER instead? Shows up on mine under there correctly.

alimbada
+3  A: 

HKEY_CURRENT_USER\Software\Classes\http\shell\open\command\(Default) is the current user's handler for the HTTP protocol (which means "default browser"; NOTE: this is NOT the same thing as the .html default handler!).

However, it is possible to have a different browser at the top of Start Menu without changing the default. FYI, the browser executable name in Start menu is stored in HKEY_CURRENT_USER\Software\Clients\StartMenuInternet\(Default).

Piskvor
Thanks. It seems I asked the wrong question. When you click an HTML file, the browser that opens is the one that has registered the HTTP protocol, not the browser which is on the start menu. This has solved my problem.
soupagain
@soupagain: Actually, no. When you click on a .html **file**, the browser that opens it is the one that has registered the .html extension. When you open a http:// **link** (e.g. by typing it into the "Start->Run" box), the browser that opens is the one that has registered the HTTP protocol (although it's usually the same browser in both cases). You are correct that whatever is displayed in Start Menu is not related to this.
Piskvor
@piskvor: Yeah, that's what I meant to say, but you explained it better.
soupagain