I know that a LPARAM variable has certain bits set(inside it) that identify information such as long key presses & etc. when I receive a WM_KEYDOWN event.
So I a
In general, you use bitwise-AND to check if a certain bit is set:
unsigned int flags; // some flags
if (flags & 0x01) { } // bit 0 is set
if (flags & 0x02) { } // bit 1 is set
if (flags & 0x04) { } // bit 2 is set
...
if (flags & (1U << n)) { } // bit n is set
However, don't rely on the physical bit values. Instead, the API defines USEFUL_CONSTANTS that describe the meaning of the flags:
LPARAM flags = ApiFunction();
if (flags & USEFUL_CONSTANT) { } // check if the flag is set
Check the API documentation of the relevant message to find out which values are defined.
Update: I see that in your case you might actually want values rather than just flags. So, to get the value of the lowest 16 bits, you just bitwise-AND the value with the corresponding bitmask: unsigned int repeat_count = flags & 0xFFFF;
Note that 0xFFFF is 1111111111111111 in binary.