7

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?

Jason Aller
  • 3,541
  • 28
  • 38
  • 38
JannisDev
  • 127
  • 1
  • 6

3 Answers3

6

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

Konstantin S.
  • 1,307
  • 14
  • 19
  • 1
    Morten Nielsen deprecated his implementation: https://github.com/dotMorten/WinUIEx/commit/b3c31ad331a061ef830fb90ed1c678e0e01949f1 – citelao May 24 '23 at 00:01
2

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

FrozenAssassine
  • 1,392
  • 1
  • 7
  • 16
0

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 :)

Mayur Paghdal
  • 275
  • 1
  • 2
  • 12