Search code examples
c++windowswinapisystem-tray

How to change systray icon text style set by Shell_NotifyIcon


When you add an icon to the system tray on Windows via Shell_NotifyIcon() function you can set the text that is shown when the mouse hovers over the icon.

NOTIFYICONDATA  systray_icon;
systray_icon.cbSize = sizeof(NOTIFYICONDATA);
systray_icon.uFlags = NIF_ICON | NIF_MESSAGE | NIF_TIP;
...
_tcscpy_s(systray_icon.szTip, TEXT("Icon text..."));
Shell_NotifyIcon(NIM_ADD, &systray_icon);

The question is: is it possible to change style of this text(set it bold/italic, change color)?


Solution

  • No. This is not set per icon; it's set per the system.

    What you could do instead (though it's a lot more work) is to open your own little window over the icon, and control it yourself. You can do whatever you want in that case, of course - but you need to take care of things such as positioning of the window (just think about the fact that the entire task bar can be positioned on the right/top/left sides of the desktop, and not only on the bottom.