Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

You should use the accessibility time-out option for computers that several users with different accessibility preferences share. Each user can use hot keys or the AccessibilityControl Panel to enable preferred functionality. The accessibility time-out period is the length of time that must pass without keyboard or mouse input before the operating system (OS) automatically turns off accessibility functionality. The time-out affects the following accessibility functionality: mouse keys, sticky keys, toggle keys, and high contrast.

The user can control the settings for the accessibility time-out option by using the Generaltab of the AccessibilityControl Panel application or another application for customizing the environment.

Applications use the SPI_GETACCESSTIMEOUT and SPI_SETACCESSTIMEOUT flags with the SystemParametersInfofunction to get and set the accessibility time-out option. The ACCESSTIMEOUTstructure defines the parameters for the accessibility time-out option. To set the accessibility time-out option, call SystemParametersInfowith the uiActionparameter set to SPI_SETACCESSTIMEMOUT, the uiParamparameter set to the size of the ACCESSTIMEOUTstructure, and the pvParamparameter set to a pointer to an ACCESSTIMEOUTstructure that contains the new time-out parameters that you want to use. You should set the ATF_TIMEOUTON flag in the dwFlagsmember of the ACCESSTIMEOUTstructure that you pass to SystemParametersInfoand set the iTimeOutMSecmember to the length of the time-out period in milliseconds.

The following code example shows how to set the accessibility time-out period to 10 minutes and how to specify that the OS should play a descending siren sound when the time-out period elapses and the OS turns off the accessibility options.

Copy Code
ACCESSTIMEOUT atf;
BOOL bSuccess;

// Fill in the members of the ACCESSTIMEOUT structure.

atf.cbSize = sizeof(ACCESSTIMEOUT);
atf.dwFlags = (ATF_ONOFFFEEDBACK | ATF_TIMEOUTON);
atf.iTimeOutMSec = 600000;

// Call SystemParametersInfo with the SPI_SETACCESSTIMEOUT flag. 

bSuccess = SystemParametersInfo(SPI_SETACCESSTIMEOUT, 
								sizeof(ACCESSTIMEOUT), (LPVOID)
&atf, 0); 

To retrieve information about the time-out period, including whether a time-out period is set and the length of the time-out period, call SystemParametersInfowith uiActionset to SPI_GETACCESSTIMEOUT, uiParamset to the size of the ACCESSTIMEOUTstructure, and pvParamset to a pointer to an ACCESSTIMEOUTstructure. Examine the values of the members of the ACCESSTIMEOUTstructure after SystemParametersInforeturns to obtain the information that you want about the accessibility time-out option.

See Also