-
Notifications
You must be signed in to change notification settings - Fork 693
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. #10036
Comments
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:
|
You can use ExtractIconEx
with
|
感谢您的回答,我已经使用 PrivateExtractIcons 从 exe 文件中获取图标并作为窗口图标显示,但我希望 Windows App SDK 或 WinUI 团队能扩展一下这个方法,可以直接从 exe 文件中读取图标,而不只是仅限于 ico 文件 |
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
Important Notes
Open Questions
The text was updated successfully, but these errors were encountered: