The question is not clear, but I can guess by "key number" you mean a raw key identifier (which comes into play before a key is recognized as a status key, character key, etc.), which is called "
scan code". You can get it as lower byte of the parameter
nFlags
of
CWnd::OnKeyDown
; please see:
http://msdn.microsoft.com/en-us/library/983st27a%28v=vs.100%29.aspx[
^].
See also:
http://en.wikipedia.org/wiki/Scan_code[
^].
You can extract scan code from
nFlags
like this:
byte scanCode = nFlags & 0xFF;
—SA