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

调用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

 

posted @ 2020-09-01 16:52  _KikyoBK  Views(209)  Comments(0Edit  收藏  举报