Вот, пожалуйста.
void outputLParam( LPARAM lParam )
{
printf("Repeat Count : %d\n", (lParam) & 0xFFFF); // print the value of the 1st 16 bits
printf("Scan Code : %d\n", (lParam >> 16) & 0xFF); // print the value of the next 8 bits
printf("Extended Key : %d\n", (lParam >> 24) & 0x1); // print the value of the next bit
printf("Reserved : %d\n", (lParam >> 25) & 0xF)); // print the value of the next 4 bits
printf("Context : %d\n", (lParam >> 29) & 0x1); // print the value of the next bit
printf("Prev Key State : %d\n", (lParam >> 30) & 0x1); // print the value of the next bit
printf("Transition Key State: %d\n", (lParam >> 31) & 0x1); // print the value of the next bit
}