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

The sticky keys option enables the user to type key combinations, such as CTRL+ALT+DEL, in sequence rather than simultaneously.

The user can control the settings for the sticky keys option by using the Keyboardtab of the AccessibilityControl Panel application or another application for customizing the environment.

Applications use the SPI_GETSTICKYKEYS and SPI_SETSTICKYKEYS flags with the SystemParametersInfofunction to get and set the sticky keys option. The STICKYKEYSstructure defines the parameters for the sticky keys option. To set the sticky keys option, call SystemParametersInfowith the uiActionparameter set to SPI_SETSTICKYKEYS, the uiParamparameter set to the size of the STICKYKEYSstructure, and the pvParamparameter set to a pointer to a STICKYKEYSstructure that contains the sticky keys parameters that you want to use. You should set the SKF_STICKYKEYSON flag in the dwFlagsmember of the STICKYKEYSstructure that you pass to SystemParametersInfo.

The following code example shows how to enable the sticky keys option and direct the OS to play a sound when the user latches, locks, or releases modifier keys when using the sticky keys option.

Copy Code
STICKYKEYS skf;
BOOL bSuccess;

// Fill in the members of the STICKYKEYS structure.

skf.cbSize = sizeof(STICKYKEYS);
skf.dwFlags = (SKF_AVAILABLE | SKF_STICKYKEYSON |
SKF_AUDIBLEFEEDBACK);

// Call SystemParametersInfo with the SPI_SETSTICKYKEYS flag. 

bSuccess = SystemParametersInfo(SPI_SETSTICKYKEYS,
sizeof(STICKYKEYS), 
								(LPVOID) &skf, 0); 

To retrieve information about the sticky keys option, call SystemParametersInfowith uiActionset to SPI_GETSTICKYKEYS, uiParamset to the size of the STICKYKEYSstructure, and pvParamset to a pointer to a STICKYKEYSstructure. Examine the values of the members of the STICKYKEYSstructure after SystemParametersInforeturns to obtain the information that you want about the sticky keys option.

See Also

508 Resource Limit Is Reached

Resource Limit Is Reached

The website is temporarily unable to service your request as it exceeded resource limit. Please try again later.