Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This 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 GetMessageor PeekMessagefunction.
BOOL TranslateMessage( const MSG *lpMsg );
Parameters
Return Values
Nonzero indicates that the message is translated, that is, a character message is posted to the thread's message queue. If the message is WM_KEYDOWN or WM_SYSKEYDOWN, the return value is nonzero, regardless of the translation. Zero indicates that the message is not translated, that is, a character message is not posted to the thread's message queue.
Remarks
The TranslateMessagefunction does not modify the message pointed to by the lpMsgparameter.
WM_KEYDOWNand WM_KEYUPcombinations produce a WM_CHARmessage. WM_SYSKEYDOWNand WM_SYSKEYUPcombinations produce a WM_SYSCHARor WM_SYSDEADCHARmessage.
TranslateMessageproduces WM_CHAR messages only for keys that are mapped to ASCII characters by the keyboard driver. Windows CE does not support scan codes or extended key flags, so it does not support the values 16 through 24 in the lKeyDataparameter ( lParam) of the WM_CHARmessage generated by the TranslateMessagefunction.
TranslateMessagecan only be used to translate messages received from calls to GetMessageor PeekMessage.
If applications process virtual-key messages for some other purpose, they should not call TranslateMessage. For instance, an application should not call TranslateMessageif the TranslateAcceleratorfunction returns a nonzero value.
Requirements
Runs on | Versions | Defined in | Include | Link to |
---|---|---|---|---|
Windows CE OS | 1.0 and later | Winuser.h | Msgque.lib |
Note This API is part of the complete Windows CE OS package as provided by Microsoft. The functionality of a particular platform is determined by the original equipment manufacturer (OEM) and some devices may not support this API.
See Also
GetMessage, PeekMessage, TranslateAccelerator, WM_CHAR, WM_KEYDOWN, WM_KEYUP, WM_SYSCHAR, WM_SYSDEADCHAR, WM_SYSKEYDOWN, WM_SYSKEYUP