ImeToAsciiEx

UINT ImeToAsciiEx(UINT uVirKey, UINT uScanCode, 
    CONST LPBYTE lpbKeyState, LPDWORD lpdwTransBuf, UINT fuState, 
    HIMC hIMC)
 

Translates messages using the IME conversion engine associated with the given input context.

The return value is the number of messages. If the number is greater than the length of the translated message buffer, the translated message buffer is not large enough. The system looks into the hMsgBuf to get the translation messages.

uVirKey
Virtual key code to be translated. When the property bit IME_PROP_KBD_CHAR_FIRST is on, the upper byte of the virtual key is the aid character code.
uScanCode
Hardware scan code of the key to be translated.
lpbKeyState
Address of a 256-byte array that contains the current keyboard state. The IME should not modify the keyboard state.
lpdwTransBuf
Address of a double word buffer to receive the translated result. The format is [Length of the pass in translated message buffer] [Message1] [wParam1] [lParam1] {[Message2] [wParam2] [lParam2]{...{...{...}}}}.
fuState
Active menu flag.
hIMC
Handle of the input context.