Search code examples
c++winapipromptsystem-tray

How to display an ampersand in a Windows system tray prompt?


I'm programming using C++ and WinAPIs. I've added a system tray icon using Shell_NotifyIcon(NIM_ADD, ...) API. That icon also has an associated user prompt that contains an ampersand symbol in it, something like this, "View & Copy." But what a user sees though when the prompt pops up, is "View Copy". I tried doubling the ampersand, like so "View && Copy" but that didn't help.

Does anyone have any idea how to display an ampersand in a Windows tray prompt?


Solution

  • Apparently, ampersands require double-escaping, like this &&&.

    I'm not sure why but it seems to work.

    My source: this link.