Getting Default browser

后端 未结 5 445
轻奢々
轻奢々 2020-12-18 02:58

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 regist

5条回答
  •  心在旅途
    2020-12-18 03:34

    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.

提交回复
热议问题