-
Notifications
You must be signed in to change notification settings - Fork 10
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
Change the default icon ID to 32512
to be in line with the Windows default.
#12
Change the default icon ID to 32512
to be in line with the Windows default.
#12
Conversation
This commit is identical to the one originally suggested for the `winres` project.
…ved the pertinent section from the old link.
I looked into it and even Microsoft binaries themselves are all over the place regarding icon IDs. However, I do commend your persistence and it seems like it is indeed the preferred icon ID. If it does not cause any breakage - which it doesn't seem to - I will merge it shortly and release a new version. |
Haha, thank you. As with everything else related to Windows, it's a mess, but I think it makes sense to match what Visual Studio uses and what the MSDN claims is the default application icon ID. |
It is done, I just released a new version: |
Just stumbled across this. To me, the Microsoft link you referred to looks like 32512 is supposed to load the general Windows default application icon:
To me, the documentation reads like you should use that number in case your application wants to load this default icon, such as it might want to load the other icons like the question mark, and not to use it for your own custom application icon. However, if Visual Studio itself uses this icon number, the documentation might just be bad / misleading (as the same-looking icon also has the id 32517). Probably this should be mentioned in the documentation (that it's the number used by VSCode itself) as the documentation doesn't look like it supports this change to me. @zedseven Have you tried adding several icons in a Visual Studio project and seeing if the main icon still has the ID? |
Update: I just found a Microsoft documentation from 1995 about which icon ID to use. It states:
I don't know if this is still true for modern operating systems, but I think this should be tested (and if icon 1 takes precedence over 32512, changed back). (Also I found this in this in the documentation to |
Update: 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. So yeah, this change isn't correct, and it might break some projects that use another icon with a lower id :/ |
Thank you for your thorough analysis. I feel like Microsoft really dropped the ball here, they should be clearer about it. Various people spent a considerable amount of time trying to figure it out and it's just confusing. Maybe in a few years, we'll see a Raymond Chen post about the mess that is resource IDs, and an in-depth exploration of the ancient and convoluted history of Windows resources, haha. |
The ID should be 1. The value 32512 is not "the value you should use for your application icon." It is "the value you should pass to LoadIcon to ask the system to give you a copy of the default application." |
@oldnewthing Thank you for the reply! Raymond Chen wrote the following additional details in an email, which I find worth adding to this discussion thread:
That settles it, then. We will set the ID to 1 by default. |
I mean that's literally what I wrote (researched and tested) half a year ago… |
Because both sides raised convincing arguments, I was not going to change it again until an authoritative or trusted source appeared. But yes, you were indeed correct. By the way, the crate is released, 0.1.19 fixes the issue. |
Ah, I'm sorry. I missed that they were from Microsoft. |
I originally submitted a PR for this to the
winres
repo (mxre/winres#39), but it was ignored. I'm hoping here I can finally get the change made.Relevant documentation:
32512
: Default icon id should be 32512 mxre/winres#28 (comment)32512
value (original link in my old PR): https://web.archive.org/web/20220106224555/https://docs.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-loadicona#32512
value: https://learn.microsoft.com/en-us/windows/win32/menurc/about-icons#icon-typesCloses #5.