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

An application can use the SystemParametersInfofunction to enable or disable an accessibility option directly. For some of the options, you can use SystemParametersInfoto enable a hot key or key combination so the user can toggle the state of an option. The sound sentry option does not have a hot key. The following table shows the accessibility options that have hot keys.

Option Hot key

Mouse keys

Press Left ALT + Left SHIFT + NUM LOCK.

Sticky keys

Press the SHIFT key 5 times.

Toggle keys

Hold down the NUM LOCK key for 8 seconds.

High-contrast mode

Press Left ALT + Left SHIFT + PRINT SCREEN.

For an option that has a hot key, an application enables the hot key by setting the dwFlagsmember of the structure that corresponds that option to a value that enables the hot key and passing that structure to SystemParametersInfo. For example, an application can enable the hot key for the mouse keys option by setting the dwFlagsmember of a MOUSEKEYSstructure to MKF_HOTKEYACTIVE and passing that structure to SystemParametersInfowith the uiActionparameter set to SPI_SETMOUSEKEYS and the uiParamparameter set to the size of the MOUSEKEYSstructure.

The following code example shows how to enable the mouse keys option, enable the hot key for that option, and direct the OS to play a siren sound when the user turns the mouse keys option on or off by using the hot key.

Copy Code
MOUSEKEYS mkf;
BOOL bSuccess;

// Fill in the members of the MOUSEKEYS structure.

mkf.cbSize = sizeof(MOUSEKEYS);
mkf.dwFlags = (MKF_AVAILABLE | MKF_MOUSEKEYSON | MKF_HOTKEYACTIVE |

			 MKF_HOTKEYSOUND);
mkf.iMaxSpeed = 200;
mkf.iTimeToMaxSpeed = 1000;
mkf.iCtrlSpeed = 2;
mkf.dwReserved1 = 0;
mkf.dwReserved2 = 0;

// Call SystemParametersInfo with the SPI_SETMOUSEKEYS flag. 

bSuccess = SystemParametersInfo(SPI_SETMOUSEKEYS,
sizeof(MOUSEKEYS), 
								(LPVOID) &mkf, 0); 

See Also