为什么屏幕锁定时气球提示会延迟?

发布于 2024-11-30 16:25:32 字数 315 浏览 1 评论 0原文

我编写的应用程序显示气球提示(使用 NotifyIcon.ShowBalloonTip()) 当某个事件发生时。系统锁定时也可能发生这种情况。

在这种情况下,气球提示在解锁后不会立即显示或根本不显示 - 两种情况都很好并且有意义。但是,它会在一段时间后显示 - 有时超过半小时。

这种行为非常烦人,我想知道是否有办法阻止它,除了在显示气球提示之前检查屏幕是否已锁定。

An application I've written displays a balloon tip (using NotifyIcon.ShowBalloonTip()) when a certain event happens. This can also happen while the system is locked.

In this case the balloon tip does not immediatels display after unlocking it or not at all - both cases would be fine and make sense. However, it displays after some time - sometimes more than half an hour.

This behaviour is very annoying and I'd like to know if there's a way to prevent it except checking if the screen is locked before showing the balloontip.

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

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

发布评论

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

评论(1

桃气十足 2024-12-07 16:25:33

任务栏通知(这是官方术语)具有与之相关的棘手逻辑。

  1. 通知会立即显示,或者从某些状态恢复后显示,例如当电脑锁定时(或玩全屏游戏时):

    http://blogs.msdn.com/ b/oldnewthing/archive/2005/01/10/349894.aspx

  2. 在 Vista 及更高版本中,通知仅显示 9 秒,并且不可调整:

    http://blogs.msdn.com/ b/oldnewthing/archive/2011/05/18/10165605.aspx

  3. 在用户首次登录的第一个小时内根本不会显示通知气球

    http://msdn .microsoft.com/en-us/library/windows/desktop/ee330740(v=vs.85).aspx

最重要的是,Windows 不保证用户会看到他们。在 Windows UX 指南中,他们指出:

不要假设用户会看到您的通知。用户不会看到
他们何时:

  • 他们全神贯注于工作。
  • 他们没有注意。
  • 他们远离电脑。
  • 他们正在运行全屏应用程序。
  • 他们的管理员已关闭其计算机的所有通知。

它还指出用户也可能无法及时看到消息,在这种情况下,您应该当消息不再相关时将其取消排队。您可以通过调用 ShowBalloonTip(0, String.Empty, String.Empty, ToolTipIcon.None) 来完成此操作。我认为这样做是防止显示不相关的气球的最佳选择。

Taskbar notifications (this is the official terminology) have tricky logic associated with them.

  1. Notifications are displayed either immediately, or after resuming from certain states, such as when the PC is locked (or playing a fullscreen game):

    http://blogs.msdn.com/b/oldnewthing/archive/2005/01/10/349894.aspx

  2. In Vista and later, notifications are only displayed for 9 seconds, and this is not adjustable:

    http://blogs.msdn.com/b/oldnewthing/archive/2011/05/18/10165605.aspx

  3. Notification balloons do not show up at all for the first hour a user is logged on for the first time:

    http://msdn.microsoft.com/en-us/library/windows/desktop/ee330740(v=vs.85).aspx

Most importantly, Windows does not guarantee that the user will see them. In the Windows UX Guidelines, they state:

Don't assume that users will see your notifications. Users won't see
them when:

  • They are immersed in their work.
  • They aren't paying attention.
  • They away from their computer.
  • They are running a full-screen application.
  • Their administrator has turned off all notifications for their computer.

It also states that the user might not see the messages in time either, in which case you should unqueue your messages when they are no longer relevant. You can do this by calling ShowBalloonTip(0, String.Empty, String.Empty, ToolTipIcon.None). I think doing this is your best bet to prevent irrelevant balloons from being shown.

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