While processing a keyboard message, an application sometimes needs to determine the status of a key different from the one that generated the current message. You can use the GetKeyState function to determine the state of certain keys. This function returns the key's state at the time the current message was generated. The GetAsyncKeyState function returns the state of the key at the time of the call.
The Windows CE version of these functions differs slightly from the desktop counterpart. Unlike the equivalent functions in Windows-based desktop platforms, GetKeyState supports only a limited number of keys, and GetAsyncKeyState returns the current key state even if a window in another thread has the keyboard focus.