Partager via


Using the Traditional Chinese Input Method (Windows Embedded CE 6.0)

1/6/2010

To use an IM, the user first selects the IM from the input panel dialog box or the Input Panel button. The input panel loads the selected IM dynamically by calling the CoCreateInstance function. When the user selects a different IM, the input panel frees the existing IM by calling the IUnknown::Release method on the interface pointer. The input panel then calls IInputMethod methods to notify the IM of events and to request data. The input panel implements and exposes the IIMCallback interface. This interface lets the IM call the input panel to send keystrokes to the application through GWES. The following table shows the methods that are available through the IIMCallback interface.

IIMCallback method Description

IIMCallback::SetImInfo

Lets the IM change the icon of the input panel and the visible state of the input panel.

IIMCallback::SendVirtualKey

Modifies the global key state.

IIMCallback::SendCharEvents

Sends Unicode characters to the window that currently has the focus.

IIMCallback::SendString

Sends strings to the window that currently has the focus.

In response to the input panel calls to methods of the IInputMethod interface, an IM creates windows in the contexts of the input panel thread. This way, the input panel and the IM belong to the same message loop. For purposes of simplicity, all calls to methods of the IIMCallback interface should be made in the input panel thread. That is, the IM should call IIMCallback methods only in response to a call coming through an IInputMethod method.

Additionally, the IM should not create a separate thread to implement a UI. Only the thread that responds to IInputMethod methods should create and manipulate windows. Instead, the IM can create process threads to implement a UI*.* However, these process threads must not call IIMCallback, because certain GWES window functions work properly only if they are created from the same thread that created the window.

See Also

Other Resources

Traditional Chinese Input Methods
IInputMethod
WindowProc
IIMCallback
CoCreateInstance
IUnknown::Release