c++ - Trying to get default web browser path fails on Windows 10 -
i'm doing following in app's installer (note installer project windows executable (setup.exe
) , not msi.)
first needed check if there're file associations .htm
, .html
file types. did already. , if there's no association needed add them opened web browser.
to make lesser of impact on user's system, thought go user's default web browser. question how find path?
so doing this:
//get default web browser path wchar wbuffpath[max_path] = {0}; dword dwszbuffpath = max_path; ::assocquerystringw(0, assocstr_executable, l"http", l"open", wbuffpath, &dwszbuffpath);
which seems work, except when run on windows 10 path (when default edge browser):
c:\windows\system32\launchwinapp.exe
so how reset of parameters start it?
try using assocstr_command
instead of assocstr_executable
. using assocstr_executable
, asking just executable itself, getting back. assocstr_command
should give whole command line executable.
Comments
Post a Comment