INFO: How Clients and Servers Should Use SPI_SETSCREENREADER and SPI_GETSCREENREADER

Article translations Article translations
Article ID: 180958
Expand all | Collapse all

On This Page

Summary

Screen readers set the system-wide SPI_SETSCREENREADER flag when they initialize and clear the flag when they terminate. Although Microsoft does not recommend that you use this method to manage changing behavior, accessibility-aware applications such as Microsoft Internet Explorer also use the flag to control how the application interacts with the system.

Because the SPI_SETSCREENREADER flag affects the behavior of these (and other) applications, you must modify the flag carefully. Additionally, the flag must always be followed by a WM_SETTINGCHANGE message. The WM_SETTINGCHANGE message makes sure that any active applications are given the opportunity to modify behavior based upon the flag's new value.

More information

Recommendation for Clients

When you modify the SPI_SETSCREENREADER flag with a call to SystemParametersInfo, you must specify SPIF_SENDCHANGE in the last parameter to broadcast a WM_SETTINGCHANGE message. By sending the WM_SETTINGCHANGE message, you make sure that all active applications are notified that the SPI_SETSCREENREADER flag has been set.

Similarly, when you write an application that depends on the value of the SPI_SETSCREENREADER flag, make sure that you handle the WM_SETTINGCHANGE message. If your application receives this message, it should take the appropriate action to preserve its appropriate operation.

For example, assume two different applications handle the SPI_SCREENREADER flag as follows (without sending or handling the WM_SETTINGCHANGE message):
  • Set SPI_SCREENREADER to TRUE when initializing.
  • Set SPI_SCREENREADER to FALSE when terminating.
If both applications start to execute, each application sets the flag to TRUE. Then, when one of these applications terminates, the other application continues to execute under the incorrect assumption that the SPI_SCREENREADER flag is still set.

To avoid this problem, an application that handles the SPI_SCREENREADER flag should always use SPIF_SENDCHANGE to make sure that other applications are notified of the change. Additionally, an application that is dependent on this flag for appropriate operation should handle the WM_SETTINGCHANGE message and react accordingly.

Recommendation for Servers

Applications should be programmatically accessible regardless of the SPI_GETSCREENREADER flag results. The system-wide flag can be used only when a screen reader-specific solution conflicts with other features or adds redundant information. The flag should not be used to completely change the user interface.

SPI_SETSCREENREADER is set while the screen reader is running on the system. Applications should respect WM_SETTINGCHANGE to track the SPI_GETSCREENREADER flag change. The changed effect should not affect your user interface globally across multi-user sessions.

For example, in the Internet Options dialog box, on the Advanced tab, Microsoft Internet Explorer adds the check box selection status (selected or cleared) followed by the check box item only when the SPI_GETSCREENREADER flag returns TRUE. The status of the check box is available through the State property of the Microsoft Active Accessibility object, but the additional label helps screen readers that do not yet support this property.

As another example, GDI+ had issues with screen magnification tools or screen readers that were resolved without introducing a scenario that relies on the SPI_GETSCREENREADER flag. For additional information about GDI+, click the article number below to view the article in the Microsoft Knowledge Base:
319261 Graphics That Are Rendered by GDI+ Cannot Be Magnified by Screen Magnifiers

References

Microsoft Active Accessibility SDK

Properties

Article ID: 180958 - Last Review: June 22, 2014 - Revision: 3.0
Keywords: 
kbaacc kbinfo kbregistry KB180958

Give Feedback

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com