为一个应用程序创建多个托盘图标

调用Shell_NotifyIcon创建托盘图标时,PNOTIFYICONDATAA参数

这里的uID设为不同的值即可

 这个参数:

 调用Shell_NotifyIcon时,Shell用hWnd加uID,或者用guidItem来识别应该操作哪一个图标。通过设置不同的uID,就可以让多个图标对应一个hWnd.如果设置了guidItem,uID会被忽略.

NOTIFYICONDATAA structure

 https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ns-shellapi-notifyicondataa

Shell_NotifyIconA函数

https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shell_notifyicona

原文地址:https://www.cnblogs.com/Toya/p/13597105.html