JannisDev
JannisDev

Reputation: 167

TrayIcon with WinUI 3

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

Answers (3)

Konstantin S.
Konstantin S.

Reputation: 1505

I know of two implementations of this in WinUI 3 in the form of ready-made NuGet libraries:

Upvotes: 7

Mayur P.
Mayur P.

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:

  1. You cannot have Context Menu for your system tray (or may be you have to do some custom code).
  2. You may experience 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

FrozenAssassine
FrozenAssassine

Reputation: 1450

Please take a look at this website:
https://stefanwick.com/2017/06/24/uwp-app-with-systray-extension

Upvotes: 2

Related Questions