microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.31k stars 676 forks source link

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

Open Gaoyifei1011 opened 2 hours ago

Gaoyifei1011 commented 2 hours ago

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

github-actions[bot] commented 2 hours ago

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one. Thank you!

Open similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.