Search code examples
windowsnotificationsiconssystemsystem-tray

I want to display numbers on the system tray notification Icons on windows


I am trying to create a notification Icon based application in which I want to display some numbers ranging from 1-999.

I looked at this video which is similar to what I want to do but here the system tray icon just displays the icon and it shows a pop up rather than the system tray icon showing the number or any text.

Excluding the popup item, all I want to do is to read a number (input from somewhere) and display that number in the notification icon section.

I am open to trying any technology (QT, .net) for doing this. Basically, I am looking for some examples.


Solution

  • While parts of your question are vague, this is very possible, I'd even dare-say quite simple. Since you mentioned you're open to trying any technology, C# would probably simplify things for you.

    • Generate a new 16 x 16 Bitmap and draw the number to it using the Graphics class.
    • Convert the Image instance to an Icon instance, after disposing of your Graphics object.
    • Set the Icon property of your NotifyIcon to the icon you've just created.

    These are the basic steps. You'll likely need to do some research if you aren't familiar with the classes used.