I need to launch the default browser on windows with c++ code.
I have found this way: use the api "AssocQueryString" to find the app which could open the file with an extend file name "html". It work well when the default browser is ie or chrome or .., but if the default browser is an UWP app such as "Microsoft Edge", I only get ""C:\Windows\system32\LaunchWinApp.exe"
DWORD size = MAX_PATH;
char buff[MAX_PATH];
int err = AssocQueryStringA(ASSOCF_INIT_IGNOREUNKNOWN, ASSOCSTR_EXECUTABLE ".html", NULL, buff, &size);
So , is there a way to launch the default UWP browser?
I have tried this
SHELLEXECUTEINFOW sei = { sizeof sei };
sei.lpVerb = L"open";
sei.lpFile = L"microsoft-edge:";
ShellExecuteExW(&sei);
But I can only run the code when I have known that the default browser is Edge, and if the default browser is an another UWP application, how to find the name to pass to the lpFile?
So, is there a way to launch the default browser without openning a specified url?