The following code fragment shows how to decode a WM_CHAR message to determine whether it indicates a key-up event or a key-down event:
USHORT fsKeyFlags;
case WM_CHAR: {
USHORT fsKeyFlags = SHORT1FROMMP(mp1);
if (fsKeyFlags & KC_KEYUP) {
.
. /* Perform key-up processing. */
.
} else {
.
. /* Perform key-down processing. */
.
}
return;
}