How long do taskbar notification balloons appear on the screen?


We saw some time ago that taskbar notification balloons don't penalize you for being away from the computer. But how long does the balloon stay up when the user is there?

Originally, the balloon appeared for whatever amount of time the application specified in the uTimeout member of the NOTIFYICONDATA structure, subject to a system-imposed minimum of 10 seconds and maximum of 60 seconds.

In Windows XP, some animation was added to the balloon, adding 2 seconds of fade-in and fade-out animation to the display time.

Starting in Windows Vista, applications are no longer allowed to specify how long they wanted the balloon to appear; the uTimeout member is ignored. Instead, the display time is the amount of time specified by the SPI_GETMESSAGEDURATION system parameter, with 1 second devoted to fade-in and 5 seconds devoted to fade-out, with a minimum of 3 seconds of full visibility. In other words, if you set the message duration to less than 1+3+5=9 seconds, the taskbar behaves as if you had set it to 9 seconds.

The default message duration is 5 seconds, so in fact most systems are in the "shorted possible time" case. If you want to extend the time for which balloons notification appear, you can use the SystemParametersInfo function to change it:

BOOL SetMessageDuration(DWORD seconds, UINT flags)
{
 return SystemParametersInfo(SPI_SETMESSAGEDURATION,
                             0, IntToPtr(seconds), flags);
}

(You typically don't need to mess with this setting, because you can rescue a balloon from fading out by moving the mouse over it.)

Note that an application can also set the NIF_REALTIME flag, which means "If I can't display the balloon right now, then just skip it."

Comments (27)
  1. Adam Rosenfield says:

    Hasn't this just been reduced to a problem of using global state to manage a local problem (blogs.msdn.com/…/9193695.aspx)?  I feel like Vista took a step backwards here, making it much more difficult for different programs to display balloons with different timeouts.

    [In practice, the only time anybody set a nonstandard timeout was to set an extra annoying timeout. -Raymond]
  2. Miff says:

    So does that mean the solution is to have poor programs affect /every/ balloon tip instead of just their "super-important-critical-look-at-me" one?

    [That is an end-user setting, not an application setting. -Raymond]
  3. Joshua says:

    Meh. The misbehaving developer might go nuclear anyway (by building his own balloon and displaying it as long as he wants).

  4. Burak KALAYCI says:

    Starting in Windows Vista, applications are no longer allowed to specify how long they wanted the balloon to appear; the uTimeout member is ignored.

    As I understand, applications are still allowed to specify what they want, it's just that Vista and W7 (and probably W8) ignore it. If this is fixed in a future version of Windows, then the sentence will be plain wrong.

    @Troll: "I don't say Vista spoiled everything"

    I think you are very wrong. Be a good troll now, will you?

  5. Nick says:

    When I read about this change on MSDN I was somewhat surprised.  I know that "bad software" can abuse a long timeout value, but isn't it the user, after all, that installed the bad software?  A few little utilities I've written to help with debugging used balloons to indicate that something would happen (in lieu of actually doing it), and now those disappear pretty quickly.

    If the program gets to decide when to show a notification, the text on the notification and the icon, and the user can dismiss it with a click, why not also give the software control over the duration?

  6. jon says:

    How is this an end-user setting? I'm be rather surprised if very many of our users new how to write a program to set SPI_SETMESSAGEDURATION.

    [The setting is an end-user setting. The end-user interface to it is clearly not writing a C program. But people who do write C programs need to understand that the setting should be changed programmatically only under the direction of the user. -Raymond]
  7. zilla says:

    Are you serious? Why would they have to write a program?????

    It IS an end user setting, try doing 5 seconds of research.

    Heck, even troll pointed it out how to do it 2 posts above yours.

    Vista/7

    Control PanelAll Control Panel ItemsEase of Access CenterUse the computer without a display

    Adjust time limits and flashing visuals

    How long should Windows notification dialog boxes stay open?

    Click the little combo box and pick a number.

    I swear, no Raymond is not right all the time, but you have to wonder how mediocre and fragile some egos are who come here day after day to try to one up or stick it to Microsoft. Oops I forgot M$.

    Way to go

  8. John says:

    [But people who do write C programs need to understand that the setting should be changed programmatically only under the direction of the user. -Raymond]

    In the old days programmers were trusted to do the right thing; I thought you guys would have learned your lesson by now.

  9. Leif Strand says:

    One of my happiest days in recent memory was when I discovered, through a bit of Googling, that you can enter a value in the registry to disable those goddamn balloons entirely.

    The only downside is, my XP laptop no longer warns me when the battery is about to die…

  10. SimonRev says:

    I think Miff's point is: Bad software developer decides his balloon tip is super important, so he calls your SetMessageDuration to make sure that everyone has to see his balloon tip.

    Now end user is afflicted super long balloons for *every* balloon.

    To phrase it in terms frequently seen on this blog: "User thinks computers are random and stupid.  Blames Microsoft for their stupid balloons.  Bad programmer collects a nice bonus for his mis-feature."

    [The alternative is what? Not letting the user customize the balloon time at all? -Raymond]
  11. Cheong says:

    @Miff: If the application is that "super important", they would have chosen the more annoying behaviour – just use a dialog box, potentially annoying enough to be parented to desktop.

  12. Troll says:

    Isn't this also user configurable in Vista and later (I don't say Vista spoiled everything). Type "Use the computer without a display" in search or from Ease of Access Center and set the time under "How long should Windows notification dialog boxes stay open"? although why it says "Notification *dialog boxes*" is beyond me.

  13. Dave says:

    Q: I feel like Vista took a step backwards here, making it much more difficult for different programs to display balloons with different timeouts.

    A: In practice, the only time anybody set a nonstandard timeout was to set an extra annoying timeout.

    Signs that you've been reading this blog for way too long, #1: You can tell from reading the initial article (a) what the first question will be and (b) what Raymond's response will be :-).

  14. Dave says:

    Control PanelAll Control Panel ItemsEase of Access CenterUse the computer without a displayAdjust time limits and flashing visuals

    Sorry, I got distracted by the disused lavatory door marked "Beware of the leopard" right next to the timeout setting.

  15. Worf says:

    Perhaps the better answer was to not let programs set it or get it, and keep the setting in the control panel. Then idiotic crap users install won't set it to be forever system-wide (and the user won't think something broke windows since all the balloons seem to not go away).

    I can tell you it's a strange behavoir when balloons don't disappear quite so speedily.

  16. Jwrayth says:

    So previously a rogue program could display a notification ballooon for an annoyingly long time. Now a rogue program can make all notification ballooons display for an annoyingly long time.

    Surely a better solution would have been to still respect the uTimeout member and have a non-programmatically accessible maximum display time as a user setting (e.g. User can specifiy a max display time in the range of 9 to 60 seconds (based off the system range you mention previously applied to uTimeout)).

    That way good applications with detailed balloons still get the time they need, and the user can still limit the display time without a rogue app being able to stomp all over the settings just to force their balloon to display longer.

    [Since this is an Accessibility setting, it needs to be programmatically accessible to accessibility tools. -Raymond]
  17. K says:

    I clearly remember that I used a third party tool to deactivate all balloons in XP. Not because they were individually an issue, but because too many processes threw out too many of them, especially those that re-appear every few hours. Windows Genuine Advantage (DRM) anyone?

  18. Random832 says:

    [The setting is an end-user setting. The end-user interface to it is clearly not writing a C program.]

    So what is the end-user interface to it? For about half of the SPI settings, the end-user interface is the control panel – the problem is the other half. When you have complained in the past about people using the registry editor to mess with these settings (other SPI settings; I don't know if/where this one is in the registry) it certainly seems like you are saying the end-user interface is to write a C program, since the reason people edit the undocumented registry keys for these is that regedit.exe is a marginally usable end-user interface.

  19. Troll says:

    @Leif Strand, you are kidding right? I *LOVE* notification balloons. They are the best way to display any message without obstructing what's on the screen, or making the user click to close them. I loved the pop balloon sound they made as well in Windows XP. Unfortunately, the notification balloon sound has been broken since the broken Vista/7 OSes came along. Even if you set the sound for "System notification" in Sounds control panel, it won't play. Larry Osterman confirmed it to me. One can fix it by editing the registry.

  20. zilla says:

    @Random832

    The end user interface has been mentioned several times in the comments.

    By Troll, myself, and several others.

    Just because you dont know where it is, doesnt mean it does not exist.

  21. Burak KALAYCI says:

    @jon says "…how to write a program to set…"

    @Raymond replies "…clearly not writing a C program. But people who do write C programs need…"

    Jon never mentioned C… I sense a 'C reality distortion field'.

    @zilla:

    About the end-user setting in Control Panel. It is very well hidden. How would you know to look under "Use computer without Display, optimize for blindness" for this setting? I'm not blind and I am using a display… The next item in the Ease of Access Center (in my copy of W7) is "Make the computer easier to see, optimize visual display". Isn't this the more appropriate category?

    And how would you know the setting is for balloons when they are referred to as 'notification dialog boxes'?

    [I assume Jon was referring to the code sample I wrote, which was in C. If my code sample were in C# I would have written "not writing a C# program." (The "optimize for visual display" is more about changing colors and fonts, not for adjusting timeouts. But I don't know why "Adjust timeouts' got dumped into the "Use a computer without a display" category. Maybe because that category had some extra room?) And the value applies to all notifications, not just balloons. (Though balloons are where you're most likely to see them.) If the title were "How long should balloons stay open?" then that would unintentionally exclude non-balloon notifications. You have to write something. -Raymond]
  22. zilla says:

    @burak

    You're argument is a strawman. Who cares how you find it? Random said it doesn't exist, it does… end of story.

    But I'll bite anyway. Do you really think an uninformed end user would know the difference between a dialog box and a balloon? My end users call it "that popup thing". They would have a hard time finding that setting if it was on the desktop. Then again it was never anyone's argument that the setting was hard to find, it was that it didn't exist and it clearly does. If you want to argue that it's hard to find, no disagreement from me. But how visible does a setting like that need to be? I've never had an end user complain, to me at least, that "gee wiz I wish I could make that balloon last longer…"

  23. Worf says:

    Maybe a little link added by Explorer that says "Adjust how long these notifications appear…" to every balloon would make it easier? All it would do is open the control panel to that page would make it easier to find.

    Or Explorer could monitor user frustration levels by seeing how often they click the X – too many times and it shortens the delay a bit…

  24. Troll says:

    "And the value applies to all notifications, not just balloons."

    I am sure the value applies only to balloon notifications. Other types of notification like message boxes don't go away automatically, do they? If they do, then it's broken because they should not.

    [A message box is not a notification in the sense being used here. The other types of notifications are things like toasts. -Raymond]
  25. Jwrayth says:

    [Since this is an Accessibility setting, it needs to be programmatically accessible to accessibility tools. -Raymond]

    I can't see why this would be needed by accessibility tools, but I'm willing to admit I'm not really in the audience that such a tool would target.

  26. Tergiver says:

    Off-topic, but related: This is a very old pet peeve, but this article reminded me of it.

    How long do tootips appear on the screen?

    The answer is.. wait for it.. based on your mouse's double-click speed setting! Really? Yes!

    So if you want tooltips to disappear faster, you need to increase your double-click speed. That means your double-clicks will have to be really fast. If you want tooltips to stay on screen longer, you have to decrease your double-click speed. That means getting a lot of double-clicks where you meant to single-click.

    No matter what speed setting you have, moving the mouse makes a tooltip go away. What if, like me, you want your tooltips to remain on screen indefinately (until you move the mouse)? You're out of luck. There is no such option.

    Would it be possible to separate double-click speed from a new "tooltip timeout" setting? One that has 'infinite' included. What are the issues involved?

  27. Charles Oppermann says:

    I started to write a comment and it got way too long and decided to make my own blog post:

    weblogs.asp.net/…/balloon-timeout-and-notification-duration.aspx

    My posting is mostly on the accessibility aspects of the message duration value and why it's better to have a global setting.

Comments are closed.