TrayIcon with WinUI 3
Asked Answered
T

3

10

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?

Trihedron answered 19/2, 2022 at 21:23 Comment(2)
A Windows Forms, or WPF, app is quite possible with .Net 6Anatropous
stefanwick.com/2017/06/24/uwp-app-with-systray-extensionHottempered
M
7

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

Merralee answered 26/4, 2022 at 21:44 Comment(1)
Morten Nielsen deprecated his implementation: github.com/dotMorten/WinUIEx/commit/…Ordovician
H
2

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

Hottempered answered 25/2, 2022 at 6:8 Comment(0)
T
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 :)

Total answered 14/3, 2022 at 7:2 Comment(1)
FYI: I couldn't get this running as of today's date. Unable to find an entry point named 'XamlCheckProcessRequirements' in DLLCorona

© 2022 - 2024 — McMap. All rights reserved.