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

set_icon uses a wrong icon ID #21

Closed
Korne127 opened this issue May 9, 2024 · 1 comment
Closed

set_icon uses a wrong icon ID #21

Korne127 opened this issue May 9, 2024 · 1 comment

Comments

@Korne127
Copy link

Korne127 commented May 9, 2024

In #12, the default icon id has been changed from 1 to 32512. I've written longer about my findings and experiments with icon IDs in this pull request, but summarized:
Visual Studio uses 32512 as the icon id if you only include one application icon. That's the main reason this change has been made. Microsoft documentation states that 32512 is used as "default application icon" but I think this documentation has been misinterpret and that you should use that number in case your application wants to load the general Windows default icon and not your own custom application icon.

Additionally, I found an old Microsoft documentation from 1995 which states that some versions of Windows choose the order in which but the newer version uses the "icon with the numerically lowest identifier" (if they're not named) and "the alphabetically first named group icons" (if one exists). This documentation has originally been used by winres as the reason to use 1 as the identifier for set_icon.

As this documentation was very old, I tested it myself and compiled two versions with Icons with both ID 1 and 32512. One version had the icon 1 in front of the icon 32512, one had the icon 32512 in front of the icon 1.
But both had the icon with the id 1 as the application icon:
image

This means that the change to 32512 isn't correct as it could break (change their application icon) projects with other icons with a lower ids.
@zedseven Can you maybe create a test project in Visual Studio with several icons and look at how they're named? Then we could change the behaviour of winresource to match that.
Perhaps Visual Studio uses 32512 only for projects with a single icon for some (outdated) convention reasons as it doesn't matter if only one icon is included, but also uses a numerical order if you include several icons.

@BenjaminRi
Copy link
Owner

See #12. The question has been settled, I changed the ID to 1 and will release it this way in the next crate release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants