Platform SDK: International Features

WM_IME_CHAR

The WM_IME_CHAR message is sent to an application when the IME gets a character of the conversion result. Unlike the WM_CHAR message for a non-Unicode window, this message can include double-byte as well as single-byte character values. For a Unicode window, this message is the same as WM_CHAR.

A window receives this message through its WindowProc function.

LRESULT CALLBACK WindowProc(
  HWND hwnd,       // handle to window
  UINT uMsg,       // WM_IME_CHAR
  WPARAM wParam,   // character code
  LPARAM lParam    // key indicators
);

Parameters

wParam
DBCS: Specifies a single- or double-byte character value. For a double-byte character, (BYTE)(wParam >> 8) contains the lead byte. Note that the parentheses are necessary because the cast operator has higher precedence than the shift operator.

Unicode: Specifies a Unicode character value.

lParam
Specifies the repeat count, scan code, extended-key flag, context code, previous key-state flag, and transition-state flag, as shown following.
Bit Meaning
0-15 Repeat count: Since the first byte and second byte is continuous, this is always 1.
16-23 Scan code: Scan code for a complete Asian character.
24 Extended key
25-28 Not used.
29 Context code.
30 Previous key state.
31 Transition state.

Remarks

For a non-Unicode window, if the WM_IME_CHAR message includes a double-byte character and the application passes this message to DefWindowProc, the IME converts this message into two WM_CHAR messages, each containing one byte of the double-byte character.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Windows 95/98: Requires Windows 95 or later.
  Header: Declared in Imm.h.

See Also

Input Method Editor Overview, Input Method Editor Messages, DefWindowProc, WM_CHAR