简体   繁体   English

在 UWP für WinUI 3 / Uno 的标题栏中未显示应用程序图标

[英]App Icon not Shown in Title Bar in UWP für WinUI 3 / Uno

I'm developing an UWP App with UNO / WinUI 3. I have put images into the Images folder in the UWP project and the application icon is shown in the taskbar as well as application icon at the exe-file.我正在使用 UNO / WinUI 3 开发一个 UWP 应用程序。我已将图像放入 UWP 项目的图像文件夹中,应用程序图标显示在任务栏中,应用程序图标也显示在 exe 文件中。

But unfortunately the App Icon is not shown in Window App Bar although I set the application icon for the UWP app.但不幸的是,虽然我为UWP应用程序设置了应用程序图标,但Window应用程序栏中没有显示应用程序图标。

Also the title in the app bar is always 'WinUI Desktop' although I set the Display Name in the App Manifest.尽管我在应用程序清单中设置了显示名称,但应用程序栏中的标题始终是“WinUI 桌面”。

窗口应用栏

Please tell me, how can I bringt the app icon to be shown in the app bar and set the window title.请告诉我,如何使应用程序图标显示在应用程序栏中并设置 window 标题。

There is no icon property or method from the Window Class . Window Class中没有图标属性或方法。 The solution is to use the Win32 APIs - WM_SETICON using PInvoke.解决方案是使用 Win32 API - 使用 PInvoke 的WM_SETICON

You might need to refer to @marb2000's reply from github link: How to change the Window Icon in WinUI Desktop您可能需要参考@marb2000 对 github 链接的回复: How to change the Window Icon in WinUI Desktop

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM