2

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.

ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
  • That's novel. It has to be environmental. Try it on another machine. This belongs at superuser.com btw. – Hans Passant Aug 20 '11 at 09:30
  • How is this something for superuser.com? I have this issue especially with balloontips created by my application. So it might be related to the method I'm using. Additionally the solution is most likely programming-related, too... – ThiefMaster Aug 20 '11 at 09:31
  • Because it is environmental. If you believe that it is related to the way you show the tips then you should have posted a code snippet to help us reproduce the behavior. That would have made it a programming question. – Hans Passant Aug 20 '11 at 09:41
  • 1
    I did mention the function. Since it's extremely simple it's not really necessary to post a snipped which does nothing but call that function... – ThiefMaster Aug 20 '11 at 09:50

1 Answers1

1

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.

Kevin McCormick
  • 2,358
  • 20
  • 20