How to run an "empty" Windows application that only has NotifyIcon?

I want to create an application that has only NotifyIcon in it. This does not have to be a β€œbasic” form. When I want to achieve something like this, I just create an invisible form and run it, but will there be a more β€œelegant” way to do this, I would like to know.

How do you usually do this? This application cannot be a Windows service, since it is important to have NotifyIcon and its context menus (each of them will run a different command).

thanks

+4
source share
2 answers

Check out this blog post :

As it turned out, it was so easy it was funny. All you have to do is create a class that inherits the iContainer interface. When you instantiate the notification icon, skip the container object.

It gives you a notification icon, but not a context menu.

+1
source

Another approach is to use a special ApplicationContext , which will have only those controls that you need: Creating a Tasktray application.

+3
source

Source: https://habr.com/ru/post/1309110/


All Articles