Reputation: 167
I am trying to make a program that runs in the background, and I want to place a Tray Icon in the Tray Icon Section of Windows.
I didn't find a solution to do this without using Windows Forms (which is not Possible in .Net 6)
Is there any other solution to display an Tray Icon or isn't it possible anymore?
Upvotes: 10
Views: 5683
Reputation: 1505
I know of two implementations of this in WinUI 3 in the form of ready-made NuGet libraries:
Upvotes: 7
Reputation: 274
It is possible but some if and buts are there. Also, you can get a System Tray Icon but some limitations such as:
Context Menu
for your system tray (or may be you
have to do some custom code).App Crash
when some specific controls are there in your window and you interact with them and then loose Focus from your app to another App. (This is the issue one has to fix in this sample POC).This is the POC i've created for various purposes on WinUI3 which also includes your requirement.
Kindly mark this as an answer if it serves your purpose.
Thanks :)
Upvotes: 0
Reputation: 1450
Please take a look at this website:
https://stefanwick.com/2017/06/24/uwp-app-with-systray-extension
Upvotes: 2