Today I was reading a new post on one of my favorite blogs, The Old New Thing by longtime Microsoft developer Raymond Chen. I got to know Raymond in the waning days of 1994 when we were working on "Chicago", the codename for what would become Windows 95. I was a rookie Program Manager for this new thing called "accessibility" and he was the go-to developer for just about anything in the guts of Windows.
In his blog post today, Raymond discusses balloon notifications in Windows, specifically why applications no longer have control over how long a notification may appear visible. In Windows 2000, an application could call the Shell_NotifyIcon function to display a popup balloon near the taskbar notification area. If you specified a timeout value via the NOTIFYICONDATA.uTimeout member, the value would be used to determine how long to display the notification.
However, starting with Windows Vista, the shell ignores the uTimeout member and instead uses the global message duration value that is set and retrieved using the SystemParametersInfo function, specifically the SPI_GET/SETMESSAGEDURATION value.
The reason for ignoring the application-supplied timeout is so that users can gain more control over their working environment. People with various sensory, cognitive and mobility disorders often request more global configuration settings to help them deal with the tremendous amount of information presented in a graphical user interface. Some examples:
- A person with low vision needs more time to read something. Having the message fade out after a few seconds is frustrating. This is true of people with certain reading disorders.
- Some cognitive disabilities affect the way people react to information display peripherally. It might take longer for some people who are focused on one area of the screen to react to something displayed in the bottom right corner.
- A person using a mouth-stick or other external aid to move the mouse pointer may need more time to move the pointer to the message so that it can be clicked and acted on.
FYI – you don't have to be disabled to have need for these options. There are many situations where otherwise so-called able-bodied people have their vision, perception and mobility affected. I have good vision, but with multiple monitors, I've missed notifications appearing on one display while my attention was focused on another display.
A "timeout" setting was something the accessibility team was pushing for in Windows 95 to give the OS and applications an indication that the user required more time to process things that would otherwise time out. There weren't balloon notifications back then, so it wasn't as urgent. With Windows XP and the explosion of non-modal timed notifications, it became imperative and thus the SPI_SETMESSAGEDURATION setting was incorporated into Windows Vista and exposed in the Ease of Access Center.
The user interface to control the message duration value is contained within a section of the Ease of Access Center:
- Click the Start button or press CTRL+ESC
- Type "ease" and choose the Ease of Access Center
- Choose "Make it easier to focus on tasks"
- The option "How long should Windows notification dialog boxes stay open" is towards the bottom of the list
The default value is 5 seconds, and can be set to 7, 15, 30, 60, and 300 seconds (5 minutes).
Some of the commenters on Raymond's posting were concerned that ignorant and/or poorly behaved applications that wish to have their notifications displayed for as long possible would abuse the SPI_SETMESSAGEDURATION value and thus adversely affect all applications.
The reason there is a public API is simply that the Ease of Access Center needs to do it. In addition, Microsoft wishes to enable other accessibility aid vendors the ability to create their own tools to meet the unique needs of their customers. Windows cannot currently segregate vendors and say, "only accessibility aids may touch this setting." If the API is public, then it can be used – and abused – by any application running with the user's permissions.
If a specific application wishes to have a message display for customizable period, then that's up to the application to handle the message display. I hope that this application would query SPI_GETMESSAGEDURATION, become informed of the user's request, and act appropriately.