如何随意隐藏任务栏气球? [英] How to hide a taskbar balloon at will?

查看:43
本文介绍了如何随意隐藏任务栏气球?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

强制任务栏图标显示气球工具提示非常简单:我需要做的就是在调用 Shell_NotifyIcon( NIM_MODIFY, ... ) 时设置 NIF_INFO 标志,气球出现,没问题.

It's very easy to force a taskbar icon to display a balloon tooltip: all I need to do is set the NIF_INFO flag when calling Shell_NotifyIcon( NIM_MODIFY, ... ), and the balloon appears, no problem.

现在,我也希望能够在不再需要气球时将其隐藏,但我找不到办法做到这一点.我尝试清除 NIF_INFO 标志并调用 Shell_NotifyIcon( NIM_MODIFY, ... ),但气球仍然存在.它确实会在几秒钟后自行消失,但这不是我想要的:当我的程序认为它应该隐藏时,我想立即隐藏它.

Now, I want to be able to hide the balloon when I no longer need it, as well, but I can't find a way to do that. I tried clearing the NIF_INFO flag and calling Shell_NotifyIcon( NIM_MODIFY, ... ), but the balloon remained. It does disappear by itself, a few seconds later, but that's not what I want: I want to hide it right away, when my program thinks it should be hidden.

使气球消失的唯一方法似乎是将图标销毁,然后再次将其添加到任务栏,但它很难看.

The only way to make the balloon disappear seems to be to destroy the icon and then add it to the taskbar again, but it's ugly.

是否可以在不重新创建任务栏图标的情况下隐藏气球?谢谢.

Is it possible to hide the balloon without recreating the taskbar icon? Thanks.

推荐答案

要立即隐藏气球,请将 NOTIFYICONDATAszInfo 成员设置为空字符串,例如nid.szInfo[0] = 0; 并调用 Shell_NotifyIcon( NIM_MODIFY, &nid ).

To immediately hide a balloon, set the szInfo member of the NOTIFYICONDATA to an empty string, like nid.szInfo[0] = 0; and call Shell_NotifyIcon( NIM_MODIFY, &nid ).

这篇关于如何随意隐藏任务栏气球?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆