TranslateMessage  IO8.08 

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 GetMessageIXKDTP or PeekMessage0X9XXX function.

BOOL TranslateMessage(

    CONST MSG *lpMsg

// address of structure with message

   );

 

 

Parameters

lpMsg

Points to an MSG5CTEF1 structure that contains message information retrieved from the calling thread s message queue by using the GetMessage or PeekMessage function.

 

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_KEYDOWNCXJO_P and WM_KEYUP1UBR_9N combinations produce a WM_CHAR4GEP_O2 or WM_DEADCHAR1NING4Y message. WM_SYSKEYDOWN7.WA3P and WM_SYSKEYUP7A010RJ combinations produce a WM_SYSCHAR1CBFLSP or WM_SYSDEADCHAR1.QA4VL message.

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 TranslateAccelerator288M6O function returns TRUE.

See Also

GetMessage, PeekMessage, TranslateAccelerator, WM_CHAR, WM_DEADCHAR, WM_KEYDOWN, WM_KEYUP, WM_SYSCHAR, WM_SYSDEADCHAR, WM_SYSKEYDOWN, WM_SYSKEYUP