如何防止气球尖端堆积?

发布于 2024-12-22 17:33:10 字数 157 浏览 1 评论 0原文

我的项目基于计时器运行一个事件。每次运行该事件时,它都会显示气球提示 1 秒。如果显示器进入屏幕保护程序并且程序继续在后台运行,则该事件会正确发生,但是当显示器从屏幕保护程序返回时,它将显示自屏幕保护程序激活以来抛出的每个气球提示。有办法防止这种情况吗?我想也许 1 秒后就可以处理掉气球,但不确定。

My project runs an event based on a timer. Every time the event is ran it shows a balloon tip for 1 second. If the monitor goes to screen saver and the program continues to run in the background, the event occurs correctly however when the monitor is brought back from the screen saver it will show every balloon tip that was thrown since the screen saver went active. Is there a way to prevent this? I thought perhaps disposing the balloon after 1 second or something but not sure.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

┼── 2024-12-29 17:33:10

Windows 提供的默认气球提示完全是蹩脚的。它的蹩脚之处之一是 ShowBalloonTip() 方法会默默将提供的延迟限制在特定的最小值和最大值内,该最小值和最大值因系统而异。有传言说典型值在 10 到 30 秒之间。当我默默地说时,我的意思是没有发出错误,但行为并不是您所期望的。当他们这样做时你不喜欢吗?解决这个问题的方法是设置一个计时器,在所需的时间间隔后触发,当计时器触发时,循环托盘图标的可见性(意思是:使其不可见,然后立即再次可见。)

The default balloontip provided by windows is totally lame. One of the ways in which it is lame is that the ShowBalloonTip() method will silently clamp the supplied delay to be within a certain minimum and maximum which varies from system to system. Rumors have it that the typical values are between 10 and 30 seconds. When I say silently I mean that no error is issued, but the behavior is just not what you would expect. Don't you love it when they do that? The way to work around it is to set up a timer to also fire after the desired time interval, and when the timer fires, cycle the visibility of the tray icon (meaning: make it invisible, and then immediately visible again.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文