This article has been archived. It is offered "as is" and will no longer be updated.
Screen readers set the system-wide SPI_SETSCREENREADER flag when theyinitialize 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 (andother) 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.
Recommendation for Clients
When you modify the SPI_SETSCREENREADER flag with a call toSystemParametersInfo, you must specify SPIF_SENDCHANGE in the lastparameter to broadcast a WM_SETTINGCHANGE message. By sending theWM_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 theSPI_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 theSPI_SCREENREADER flag as follows (without sending or handling theWM_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 toTRUE. Then, when one of these applications terminates, the otherapplication continues to execute under the incorrect assumption thatthe SPI_SCREENREADER flag is still set.
To avoid this problem, an application that handles the SPI_SCREENREADERflag 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