IME Sample: Demonstrates How to Control IME Mode and Implement IME Level 3

The IME sample uses CIMEEdit, a subclass of CEdit, to create an edit control. CIMEEdit handles all input characters, and it composes DBCS strings. The sample has the following features:

To use IME functions, your program must include IMM.H and link with IMM32.LIB.

Security Note

This sample code is provided to illustrate a concept and should not be used in applications or Web sites, as it may not illustrate the safest coding practices.

Building and Running the Sample

Note

If you are running Visual C++ Express Edition, you might need to install the Platform SDK before running this sample. For information on how to do this, see How to: Use Visual C++ Express Edition with the Microsoft Platform SDK.

To build and run this sample

  1. Open the solution IME.sln.

  2. From the Build menu, click Build.

  3. From the Debug menu, click Start Without Debugging.

Run the sample and try out the following features.

Control IME Mode

  • You can change IME mode using check boxes. If you change options using check boxes, the status of the IME window will be changed.

  • You can change IME mode using the IME window. If you change options using the IME window, check boxes in the sample will be changed.

  • You can enable or disable IME.

Implement IME Level 3

  • If you input double-byte characters, you can see how to composite strings.

  • If you have the proper font on Windows 2000, you can see surrogate characters.

Classes and Keywords

This sample demonstrates the following classes:

CEdit

This sample demonstrates the following keywords:

CBitmap::OnPaint; CEdit::OnChar; CEdit::OnSetFocus; CEdit::OnKillFocus; CEdit::OnKeyDown; CEdit::WindowProc; ImmGetContext; ImmReleaseContext; ImmGetConversionStatus; ImmSetConversionStatus; ImmGetOpenStatus; ImmSetOpenStatus; ImmAssociateContext; ImmNotifyIME; ImmGetCompositionString; ImmGetProperty; ImmSetCandidateWIndow; ImmSetCompositionWIndow