开发者

Force showing system tray notification balloons

开发者 https://www.devze.com 2022-12-10 08:35 出处:网络
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.

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/

0

精彩评论

暂无评论...
验证码 换一张
取 消