Visual-studio – Getting Default browser

browsermfcvisual-c++visual-studiowinapi

How can I determine which is the default browser in my system programatically. The code must be developed using vc++
Is there any API for this ?

Where in the registry is the default browser value stored?

Best Solution

You normally do not need to know this. ShellExecute(0,0,"http://stackoverflow.com",0,0,SW_SHOWNORMAL); will do the trick. Windows will spot the http:// and figure out from there that you want to open a URL. The "default" webbrowser is pretty much defined as the webbrowser used by Windows for this task.

It's not just http:// which is supported. ShellExecute can start the default webbrowser with https:// URLs as well. For mailto: URLs, it starts the default mail client.