Delphi 应用程序托盘图标上的气球提示不断弹出
我有一个 Delphi 2006 应用程序,可以最小化为托盘图标,并通过托盘图标上的气球提示显示各种警报消息。
在某些情况下 - 我不知道什么时候 - 先前显示的气球提示会不断弹出并且不会消失。它会显示设定的时间长度,关闭,然后立即重新出现。
它始终是来自此应用程序的气球提示。
如果应用程序显示另一个气球提示(该提示在编程的时间内显示),则虚拟提示将恢复。
就好像提示被困在队列中的某个地方并且不会被删除。在没有人有灵感的情况下(我意识到这是一个渺茫的机会......),有人知道如何清除气球提示吗?
I have a Delphi 2006 app that can minimize to a tray icon, and displays various alert messages via a balloon hint over the tray icon.
Under some circumstances - I don't know when - a previously displayed balloon hint keeps popping up and won't go away. It displays for the length of time programmed, closes, then immediately reappears.
It is always a balloon hint from this app.
If the app displays another balloon hint, that one shows for the programmed time, then the phantom hint resumes.
It is as if the hint is stuck in a queue somewhere and doesn't get removed. In absence of anyone with some inspiration (I realise it's a long shot...), does anyone know how to purge the balloon hints?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您使用哪个 TrayIcon? “Vcl.ExtCtrls”中的TCustomTrayIcon使用TNotifyIconData将Popup发送到TrayIcon。某些属性需要 Windows Vista 或更高版本。
您可以通过处理托盘图标发送的消息来查看正在发生的情况。
Which TrayIcon are you using? The TCustomTrayIcon in "Vcl.ExtCtrls" uses TNotifyIconData to send the Popup to the TrayIcon. Some properties require Windows Vista or later.
You can see whats going on by handling messages send by the trayicon.
我在 VB.NET 中也遇到同样的问题。我的应用程序通过系统托盘中的气球提示显示错误消息。当同时出现多个错误时,气球提示会坚持正常超时并一个接一个地显示错误。看起来有某种缓冲区可以记住您尝试显示气球提示的实际次数。如果您停止显示新的气球提示并等待足够长的时间,它最终会停止。
我的目标是在另一个气球出现时立即关闭当前的气球提示,但我还没有想出办法。所以这只是解决方案的一半。
[添加完整解决方案]
完整解决方案非常简单。在显示新的气球提示之前执行此操作(其中 Tray 是您的 TrayIcon/NotifyIcon)。
I'm facing the same problem in VB.NET. My application shows error messages through a balloontip in the systray. When there are multiple errors at once the balloontip sticks to it's normal timeout and shows the errors one after another. It looks like there is some sort of buffer that remembers the actual number of times you try to show the balloontip. If you stop showing new balloontips and wait long enough it would eventually stop.
My goal would be to close the current balloontip as soon as another one comes in, but i haven't figured out to do it yet. So this is only half a solution.
[Added full solution]
The full solution was very simple. Do this before showing a new balloontip (Where Tray is your TrayIcon/NotifyIcon).