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

While processing a keyboard message, an application sometimes needs to determine the status of a key that is different from the key that generated the current message. You can use the GetKeyStatefunction to determine the states of certain keys. This function returns the state of the key at the time that the current message was generated. The GetAsyncKeyStatefunction returns the state of the key at the time of the call.

The Windows Embedded CE version of these functions differs slightly from the desktop version. Unlike the equivalent functions in Windows-based desktop operating systems, GetKeyStatesupports only a limited number of keys, and GetAsyncKeyStatereturns the current key state even if a window in another thread has the keyboard focus.

See Also