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

Proposal:The AppWindow.SetIcon() set icon supports exe or dll files, as does the IExplorerCommand.GetIcon() method. #4773

Closed
Gaoyifei1011 opened this issue Oct 4, 2024 · 1 comment

Comments

@Gaoyifei1011
Copy link

Gaoyifei1011 commented Oct 4, 2024

Proposal: The AppWindow.SetIcon() set icon supports exe or dll files, as does the IExplorerCommand.GetIcon() method.

AppWindow.SetIcon() 设置图标支持 exe 或者 dll 文件,就像 IExplorerCommand.GetIcon() 方法那样。


Summary

AppWindow.SetIcon() method currently only supports two ways to set icons, one is to directly add ico file path, the other is to add loaded icon handle, hopefully in the future can support more ways, such as GetIcon() method in IExplorerCommand,We can just add the dll file path and the index to display the icon. Hopefully, this will work for AppWindow.SetIcon() as well

----------------------

AppWindow.SetIcon() 方法设置图标目前仅支持两种方式,一种直接添加 ico 的文件路径,另一种是添加已加载的图标句柄,希望未来可以支持更多方式,比如在 IExplorerCommand 的 GetIcon() 方法,我们可以直接添加 dll 的文件路径和图标对应的索引来显示对应的图标,希望这个方法也能运用在 AppWindow.SetIcon() 上


Reference links(参考链接)
IExplorerCommand.GetIcon(): https://learn.microsoft.com/zh-cn/windows/win32/api/shobjidl_core/nf-shobjidl_core-iexplorercommand-geticon
AppWindow.SetIcon: https://learn.microsoft.com/zh-cn/windows/windows-app-sdk/api/winrt/microsoft.ui.windowing.appwindow.seticon?view=windows-app-sdk-1.6


Rationale

This allows us to directly use the application's icon as the window icon

----------------------

这样我们可以直接使用应用程序的图标作为窗口图标

Scope

Capability Priority
This proposal will allow developers to accomplish W Must
This proposal will allow end users to accomplish X Should
This proposal will allow developers to accomplish Y Could
This proposal will allow end users to accomplish Z Won't

Important Notes

Open Questions

@Gaoyifei1011 Gaoyifei1011 changed the title Proposal:The AppWindow.SetIcon() set icon supports exe or dll files, as does the IExplorerCommand.SetIocn() method. Proposal:The AppWindow.SetIcon() set icon supports exe or dll files, as does the IExplorerCommand.GetIcon() method. Oct 4, 2024
@codendone
Copy link
Contributor

We'll track this via microsoft/microsoft-ui-xaml#10036.

@codendone codendone closed this as not planned Won't fix, can't repro, duplicate, stale Oct 6, 2024
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