-
Notifications
You must be signed in to change notification settings - Fork 967
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
SystemIcons outdated? #8842
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
@dotnet/area-system-drawing |
@RussKie does Winforms require such icons? |
Tagging subscribers to this area: @dotnet/area-system-drawing Issue DetailsIs the SystemIcons outdated? Should the SystemIcons return the shell icons? As described here:
|
I am not aware of any asks in the Windows Forms SDK for these. |
@RussKie |
Windows Forms SDK doesn't use SystemIcons at all - we don't have any of the referred interop definitions, and we call Windows MessageBox API directly. winforms/src/System.Windows.Forms.Primitives/src/Interop/User32/Interop.MessageBoxW.cs Lines 12 to 20 in d46ad2e
winforms/src/System.Windows.Forms/src/System/Windows/Forms/MessageBox.cs Lines 347 to 407 in 4381586
|
@Rand-Random we're just calling LoadIcon. Do you have a pointer to what you propose we should do instead (or as well)? |
@danmoseley - calling SHGetStockIconInfo seems to get more up-to-date icons, so that would be my proposal if the switch is feasible I would also recommend extending systemicons with all possibilities of SHGetStockIconInfo as described here: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ne-shellapi-shstockiconid though I can’t say if switching from LoadIcon to SHGetStockIconInfo is the better approach than to update LoadIcon returning up-to-date icons as a side note: |
There's a lot of such icons: https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ne-shellapi-shstockiconid |
This issue has been marked |
@ViktorHofer |
Referring to @danmoseley's previous comment:
A good next step would be to discuss if these icons are required and loop some other people in as well. |
cc @JeremyKuhne |
I think we should expose a new Something like the following: namespace System.Drrawing;
public static class SystemIcons
{
/// <summary>
/// Gets the specified stock shell icon.
/// </summary>
public static Icon GetStockIcon(StockIcon stockIcon);
}
public enum StockIcons
{
DocumentNoAssociation = 0,
DocumentWithAssociation = 1,
Application = 2,
Folder = 3,
OpenFolder = 4,
Drive525 = 5,
Drive35 = 6,
DriveRemovable = 7,
DriveFixed = 8,
DriveNetwork = 9,
DriveNetworkDisabled = 10,
DriveCD = 11,
DriveRAM = 12,
World = 13,
Server = 15,
Printer = 16,
// ...
} Here is a current related WinForms runtime issue: #7390 |
@JeremyKuhne I would argue against
Because this can be said, about every time Windows decided to update icons. Lets assume Windows did update the Icons for every operating system, we would already have 11 different Icon versions. I would argue against and say that "SystemIcons" should ALWAYS return the icons of the current System, and not Icons from an older system. If you want to support Icons from older Systems you should fully commit to the idea and have a public API where you can define which SystemIcon you want and from which System. eg.
|
@Rand-Random yes, the difference here is that we never updated the existing ones. That would be the behavior change and the reason for the new API that always gets the current icons. If you use the new API it will be documented as being "current". There are also significantly more icons available, which also helps justify a new API. @ViktorHofer two things here:
|
Created an API proposal. #8802. @ViktorHofer Once it is approved I'll represent in API review. Once we've moved System.Drawing to the WinForms repo I'll implement unless someone else is particularly eager. :) |
There is another approach to get the modern icons exist - so called "font icons": Segoe UI Symbol - Windows 8 UPDATE: |
Is the SystemIcons outdated? Should the SystemIcons return the shell icons?
As described here:
https://stackoverflow.com/questions/24257506/how-can-i-get-messagebox-icons-in-windows-8-1
SHGetStockIconInfo
vsLoadIcon
The text was updated successfully, but these errors were encountered: