In my software I'm using ShellExecuteEx
to open a report that is presented as a local .htm
file. At times on some end-user systems there's no default file association for the .htm
files.
To set such file association up on a pre-Windows 10 system I'd install the following registry keys to use IE:
Key: HKEY_CURRENT_USER\Software\Classes\htm.file\Shell\open\Command
REG_SZ name: ""
REG_SZ value: "C:\Program Files (x86)\Internet Explorer\iexplore.exe" "%1"
Key: HKEY_CURRENT_USER\Software\Classes\.htm
REG_SZ name: ""
REG_SZ value: htm.file
Key: HKEY_CURRENT_USER\Software\Classes\.htm
REG_SZ name: PerceivedType
REG_SZ value: Document
Then I notify Windows Explorer of the change:
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
It works well, but how do you do the same for Microsoft Edge on Windows 10?
PS.:
I don't want to use IE there because it always shows an extra tab with the nag to switch to Edge, which is very confusing for my end-users.
.htm
. Although, please note that I'm not talking about changing the default web browser. This is about opening a local file with the local path that has.htm
extension. PS. Going back to what you described, I guess that anti-trust lawsuit in the late 90's didn't teach MS anything. hah. – c00000fd