Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve the quality and accuracy of icon's fileextension attribute resolution (Icon::ResolveFileExtensionIcon()) #167

Closed
end2endzone opened this issue Aug 26, 2024 · 0 comments · Fixed by #169
Labels
bug Something isn't working enhancement New feature or request
Milestone

Comments

@end2endzone
Copy link
Owner

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.

Additional context
N/A

@end2endzone end2endzone added bug Something isn't working enhancement New feature or request labels Aug 26, 2024
@end2endzone end2endzone added this to the 0.10.0 milestone Aug 26, 2024
@end2endzone end2endzone changed the title Improve the resolution quality and accuracy for Icon's fileextension attribute. Improve the quality and accuracy of icon's fileextension attribute resolution (Icon::ResolveFileExtensionIcon()) Aug 26, 2024
end2endzone added a commit that referenced this issue Aug 26, 2024
end2endzone added a commit that referenced this issue Aug 26, 2024
…tension attribute resolution (Icon::ResolveFileExtensionIcon()).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant