TranslateMessage
The TranslateMessage
function translates virtual-key messages into character messages. The character
messages are posted to the calling thread s message queue, to be read the next
time the thread calls the GetMessage0X9XXX function.
BOOL TranslateMessage(
CONST MSG *lpMsg |
// address of
structure with message |
); |
|
Parameters
lpMsg
Points to an MSG
Return Values
If the
message is translated (that is, a character message is posted to the thread s
message queue), the return value is nonzero.
If the
message is not translated (that is, a character message is not posted to the
thread s message queue), the return value is zero.
Windows
NT: The TranslateMessage
function returns a nonzero value for function and arrow keys as well as for
character and digit keys.
Remarks
The TranslateMessage
function does not modify the message pointed to by the lpMsg parameter.
WM_KEYDOWN and WM_KEYUP
TranslateMessage produces WM_CHAR messages only for keys that are mapped
to ASCII characters by the keyboard driver.
If
applications process virtual-key messages for some other purpose, they should
not call TranslateMessage. For instance, an application should not call TranslateMessage
if the TranslateAccelerator
See Also