Microsoft KB Archive/180958

{|
 * width="100%"|

INFO: How Clients Should Use SPI_SETSCREENREADER

 * }

Q180958

-

The information in this article applies to:


 * Microsoft Win32 Software Development Kit (SDK)

-

SUMMARY
Screen readers set the system-wide SPI_SETSCREENREADER flag when they initialize and clear it when they terminate. This flag is used by Accessibility-aware applications such as Internet Explorer (IE) and Word to control how the application interacts with the system.

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

MORE INFORMATION
When you modify the SPI_SETSCREENREADER flag with a call to SystemParametersInfo, you need to specify SPIF_SENDCHANGE in the last parameter to broadcast a WM_SETTINGCHANGE message. Sending the WM_SETTINGCHANGE message ensures 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, be sure to handle the WM_SETTINGCHANGE message. If your application receives this message, it should take the appropriate action to preserve its proper operation.

For example, assume two different applications manipulate the SPI_SCREENREADER flag as follows (without sending or handling the WM_SETTINGCHANGE message):

* Set SPI_SCREENREADER to TRUE when initializing.

If both applications begin executing, each application will set the flag to TRUE. Then, when one of these applications terminates, the other application will continue to execute under the incorrect assumption that the SPI_SCREENREADER flag is still set.
 * Set SPI_SCREENREADER to FALSE when terminating.

To avoid this problem, an application that manipulates the SPI_SCREENREADER flag should always use SPIF_SENDCHANGE to ensure other applications are notified of the change. Furthermore, an application that is dependent on this flag for proper operation should handle the WM_SETTINGCHANGE message and react accordingly.

The following list contains two example of the type of runtime adjustments that are made (by IE and Word) in response to changes in this system-wide flag.

When the SPI_SETSCREENREADER flag is set:


 * IE expands the bounding rectangle of graphic objects to allow the entire contents of the graphic objects' ALT text tags to be displayed. This allows screen readers to obtain the contents of an ALT text tag, regardless of the dimensions of the graphic it describes.
 * Word sends notifications of focus changes so that screen readers can keep the user informed of their current state and location.