Taskbar notifications (this is the official terminology) have tricky logic associated with them.
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
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
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.