Guide to Input Method programming

Source: Internet
Author: User
Tags mixed

Windows 95 Input Method Editor (IME)

Original: Microsoft

Translation: Tbsoft Software Studio

One, about Windows 95 mixed language IME

In Windows 95, the IME is a dynamic-link library (DLL), and unlike the Windows 3.1 far-east version of the IME, each running IME is equivalent to one of the mixed-language keyboard layouts. The Windows 95 Mixed language IME provides the following enhancements compared to the Windows 3.1 IME:

A part of the runtime that is equivalent to a mixed language environment

Provide multiple input contexts for each application task

Provides an active IME for each application thread

Provides information to applications through application message loops (message order cannot be changed)

Provides strong support for non-IME support applications and partial IME support applications

To get all the enhancements, the application needs to support the Windows i/f IME application.

This document describes the application i/f of the Windows IME architecture.

1, the structure of the IME

Windows IME must provide two parts: an IME conversion interface and an IME user interface. The IME conversion interface is provided by a set of IME module extraction functions that are invoked by the IMM (Input Method Manager-translator).

The IME user interface is provided by a set of windows that receive messages and provide the user interface for the IME.

2. IME Support Application (IME-aware application-translator note)

The application has the following types:

No IME support application: This application does not control the IME, however, if the application accepts DBCS characters, the user can enter DBCS characters in the application through an IME.

Partial IME Support applications: This application controls only the different IME contexts, such as opening and closing the IME, writing windows, and so on, but not displaying any IME user interface again.

Full IME Support applications: This application is responsible for managing any information that is displayed to an application through an IME.

In Windows 95, a non-IME-enabled application has a default IME window and a default input context.

Some IME support applications create their own IME windows using predefined "IME" classes to manage or not manage their own input contexts.

A full IME enables the application to manage the input context itself, displaying any required information given by the input context, without using an IME window.

Second, IME user interface

The IME user interface includes an IME window, a user interface (UI) window, and a widget for the UI window.

1, characteristics

An IME class is a predefined global window class that implements the section of the IME user interface. The IME class has many of the same characteristics as a predefined public control window class, and the IME window instance is created by the CreateWindowEx function like static control, and the IME class window does not respond to user input and instead receives different types of control messages to implement all IME user interfaces. Your application can use the IME class to create its own IME window, and you can use the Immgetdefaultimewnd function to get the default IME window. Creating your own IME window or an application that uses the default IME window is called an IME support application, with the following benefits (compared to the corresponding Windows3.1 application):

Includes a candidate List window (candidate window), each application can have its own user Interface window instance, allowing the user to stop and switch to another application halfway through any input process. In the Windows 3.1 Japanese version, the current input process must be discarded when the user switches to another application.

Because the IME user Interface window includes the application window handle, the IME user Interface window can provide the default behavior for the application. For example, when the application moves, the IME user Interface window automatically moves, automatically follows the caret position in the window, identifies the pattern for each application, and so on.

The IME window still has two types, even if the system only provides an IME class. One type is an IME window that is created by the system to support an application without an IME, the DefWindowProc function handles messages for that window, and the IME user interface for the DefWindowProc function is shared by all of the thread's no IME-enabled windows, which is called the default IME window in the document. Another type is an IME that supports an application-created IME window, in which the IME supports an application-created IME window called an Application IME window.

2, Default and Application IME window

The system creates a default IME window when the thread initializes, which means that the thread automatically obtains the default IME window. The default IME window provides an IME user interface for non-IME-enabled applications, and when an IME or IMM generates an IME message (wm_ime_*), no IME-enabled application passes the message to the DefWindowProc function. The DefWindowProc function sends the required message to the default IME window that provides the default IME user interface for the application. IME support applications You can also use the default IME window when you do not get messages from the IME, and you can use your own IME window if you want.

3. IME Class

The IME class is a predefined window class in the Far East version of Windows 95, just as edit is a predefined window class. The predefined IME class implements all the IME user interfaces, handles all messages from the IME and applications that contain the IMM function, and the application uses the IME class to create its own IME window. The system IME class cannot be replaced by any IME.

The window procedure interacts with the IME class by Wm_ime_select message, which includes the keyboard layout of the newly selected IME, and the IME class uses the keyboard layout to find the class name defined by each IME. Using the class name, the IME class creates an IME user interface window for the currently active IME.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.