ShellAnything is a C++ open-source software which allow one to easily customize and add new options to *Windows Explorer* context menu. Define specific actions when a user right-click on a file or a directory.
MIT License
183
stars
27
forks
source link
Improve the quality and accuracy of icon's fileextension attribute resolution (Icon::ResolveFileExtensionIcon()) #167
Is your feature request related to a problem? Please describe.
On a Win10 system, the file extension "html" resolves the icon to C:\Program Files\Internet Explorer\iexplore.exe, -17. For my system, this is highly inaccurate since I do have Google Chrome installed as the default browser.
Describe the solution you'd like
The default icon should resolve to C:\Program Files\Google\Chrome\Application\chrome.exe, 0. Another way of putting it, would be to get the same icon as you do with File Explorer when you create a blank file with file extension. You want to get the same icon as the file.
Describe alternatives you've considered
We should leave the actual implementation available as a legacy feature.
Implementing a new resolution algorithm based on ExtractAssociatedIconExW with the following code as example :
HINSTANCE hInstance = GetModuleHandle(NULL);
char buffer[MAX_PATH];
sprintf(buffer, "E:\\Temp\\tmp.html");
WORD index = 0;
WORD id = 0;
HICON hIcon = ExtractAssociatedIconExA(hInstance, buffer, &index, &id);
if ( hIcon == NULL )
{
DWORD dwLastError = GetLastError();
printf("dwLastError = 0x%x", dwLastError);
}
if ( hIcon != NULL )
DestroyIcon(hIcon);
Note that file E:\Temp\tmp.html must exists on system for the resolution to be successful.
Is your feature request related to a problem? Please describe. On a Win10 system, the file extension "html" resolves the icon to
C:\Program Files\Internet Explorer\iexplore.exe
,-17
. For my system, this is highly inaccurate since I do have Google Chrome installed as the default browser.Describe the solution you'd like The default icon should resolve to
C:\Program Files\Google\Chrome\Application\chrome.exe
,0
. Another way of putting it, would be to get the same icon as you do with File Explorer when you create a blank file with file extension. You want to get the same icon as the file.Describe alternatives you've considered
Note that file
E:\Temp\tmp.html
must exists on system for the resolution to be successful.Additional context N/A