My application (C++ WinAPI) creates an icon in the system tray. I have set a tooltip text for this icon, so that when a user places a mouse cursor over the icon, this text shows.
But I want to programmatically show different balloon notications when certan events occur and at the same time keep that behavior of showing the constant notification message when a user places a mouse over the icon.
How to achie开发者_Go百科ve this in C++ WinAPI?
Thanks
Alexander Smirnov
You can add the balloon using the .szInfo
(message) and .szInfoTitle
(title) members of the NOTIFYICONDATA
structure that you send to Shell_NotifyIcon()
. The mouse-over tooltip text is set in .szTip
so this is independent of the balloon - as long as you keep .szTip
to the tooltip you want you can do as much NIM_MODIFY
calls to change the balloon while not changing anything to the tooltip.
See http://www.stromcode.com/2008/03/02/cwin32-the-system-tray-and-balloon-tips/
精彩评论