A way to ensure that a system tray icon is removed… guaranteed

后端 未结 8 2496
广开言路
广开言路 2021-02-20 10:21

Is there a way to guarantee that your system tray icon is removed?

To add the system tray icon you do:

Shell_NotifyIcon(NIM_ADD, &m_tnd);
         


        
8条回答
  •  青春惊慌失措
    2021-02-20 11:07

    Does not directly address your problem, but this was a very helpful work around for me:

    I wanted to avoid confusing system-tray states. So for me, it was sufficient to 'refresh' the notification tray on startup. This was trickier than I first thought, but the following demonstrates a SendMessage solution that simulates a user-mouse-over cleanup that doesn't involve needing to actually move the user's cursor around.

    Note that on Windows 7 machines the name Notification Area should be replaced with User Promoted Notification Area.

提交回复
热议问题