I have a html file and I want to open it from my mfc application, One way is shellexecute and it works, but the problem is that you have to pass iexplorer.exe location to the shellexecute as a parameter, which is usually c:\Program Files…. but what if IE is not in c:? what if windows is in another drive like d:? Is there any other way to do this? or is there any function that returns the windows drive?
Share
You’re overthinking it. Just call ShellExecute with just the URL:
ShellExecute(0, NULL, pszURL, NULL, NULL, SW_SHOWDEFAULT);
It will open with the default browser.