Launch web page from my application Launch web page from my application windows windows

Launch web page from my application


#include <windows.h>void main(){   ShellExecute(NULL, "open", "http://yourwebpage.com",            NULL, NULL, SW_SHOWNORMAL);}


I believe you want to use the ShellExecute() function which should respect the users choice of default browser.


Please read the docs for ShellExecute closely. To really bulletproof your code, they recommend initializing COM. See the docs here, and look for the part that says "COM should be initialized as shown here". The short answer is to do this (if you haven't already init'd COM):

CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE)