找回密码
 立即注册

QQ登录

只需一步,快速开始

graper

高级会员

45

主题

63

帖子

1348

积分

高级会员

积分
1348

活字格认证

graper
高级会员   /  发表于:2009-12-15 16:39  /   查看:13246  /  回复:0
Post by "KevinShan",  12-04-2007, 10:11
-----------------------------------------------------

Win32 Multilingual IME Overview for IME DevelopmentThis documentation introduces the basics on how to develop an IME for Windows® 95, Windows® 98, and Windows® NT/2000. It is also a supplement to the Win32® Multilingual IME API reference for IME development
The following main topics are discussed:
Overview
IME User Interface
IME Input Context
Generating Messages
ImeSetCompositionString
Soft Keyboard
Reconversion
IME Menu Functions
IME Help File
Windows NT/2000 Issues
IME File Format and Data Structures
OverviewBeginning with Windows 95 and Windows NT® 4.0, Input Method Editors (IMEs) are provided as a dynamic-link library (DLL), in contrast to the IMEs for the Windows 3.1 East Asian Edition. Each IME runs as one of the multilingual keyboard layouts. In comparison to the Windows 3.1 IME, the new Win32 Multilingual Input Method Manager (IMM) and Input Method Editor (IME) architecture provide the following advantages:
  • Run as a component of the multilingual environment
  • Offer multiple Input Contexts for each application task
  • Keep one active IME per each application thread
  • Give information to the application through message looping (no message order broken)
  • Offer strong support for both IME-aware and IME-unaware applications
To fully utilize these advantages, an application needs to support the new Win32 IMM/IME application interface.
In order to maintain maximum compatibility with existing Windows 95 and Windows NT 4.0 IMEs, Windows 98 and Windows 2000 have not changed significantly in design. However, new features have been added in order to provide better system integration and to support more intelligent IMEs.
Note  IME developers must use the immdev.h in DDK, which is a superset of the imm.h in the SDK or other development tools.
Windows 98 and Windows 2000 IMM/IMEThe Windows 98 and Windows 2000 IMM/IME architecture retains the Windows 95 and Windows NT 4.0 design. However, some changes have been made in order to support intelligent IME development and integration of the IME with Windows. These changes include:
  • New IME functions that allow applications to communicate with the IMM/IME. These include: ImmAssociateContextEx
    ImmDisableIME
    ImmGetImeMenuItems
  • New functions that allow the IME to communicate with IMM and applications. These include: ImmRequestMessage
    ImeGetImeMenuItems
  • Supporting reconversion This is a new IME feature that allows you to reconvert a string that has already been inserted into the application’s document. This function will help intelligent IMEs to get more information about the converted result and improve conversion accuracy and performance. This feature requires that the application and the IME cooperate.
  • Adding IME menu items to the Context menu of the System Pen icon This new feature provides a way for an IME to insert its own menu items into the Context menu of the System Pen icon in the system bar and in applications.
  • New bits and flags for the IME The following new bits support new conversion modes:
    IME_CMODE_FIXED
    IME_SMODE_CONVERSATION
    IME_PROP_COMPLETE_ON_UNSELECT
  • Edit control enhancement for the IME Through two new edit control messages, EM_SETIMESTATUS and EM_GETIMESTATUS, applications can manage IME status for edit controls.
  • Changing IME Pen Icon and Tooltips Through three new messages, INDICM_SETIMEICON, INDICM_SETIMETOOLTIPS, and INDICM_REMOVEDEFAULTMENUITEMS, IME can change the system Pen Icon and Tooltips in the system task bar.
  • Two new IMR messages IMR_QUERYCHARPOSITION and IMR_DOCUMENTFEED help the IME and application to communicate position and document information.
  • 64-bit compliant Two new structures (TRANSMSG and TRANSMSGLIST) are added into IMM32. They are used by INPUTCONTEXT and ImeToAsciiEx to receive IME translated message.
  • IME_PROP_ACCEPT_WIDE_VKEY This new property is added into Windows 2000 so IME can handle the injected Unicode by SendInput API. ImeProcessKey and ImeToAsciiEx APIs are updated to handle injected Unicode as well. The injected Unicode can be used by application and handwriting programs to put Unicode strings into input queue.
Win32 IME StructureA new Win32 IME has to provide two components. One is the IME Conversion Interface and the other is the IME User Interface. The IME Conversion Interface is provided as a set of functions that are exported from the IME module. These functions are called by the IMM. The IME User Interface is provided in the form of windows. These windows receive messages and provide the user interface for the IME.
IME Aware ApplicationsOne of the main advantages of the new Win32 IME architecture is that it provides better communication logic between the application and the IME. Following is an example of how an application could be involved with the IME:
  • IME Unaware Applications These kinds of applications never intend to control the IME. However, as long as it accepts DBCS characters, a user can type any DBCS character to the application using IME.
  • ME Half-aware Applications These kinds of applications typically control the various contexts of the IME, such as open and close, and composition form, but it does not display any user interface for the IME.
  • IME Full-aware Applications These kinds of applications typically want to be fully responsible for displaying any information given by the IME.
In Windows 95 and Windows NT 4.0 or later, one IME unaware application will be supported with one Default IME window and one Default Input Context.
An IME half-aware application will create its own IME window(s), also called an application IME window, using a predefined system IME class, and may or may not handle its own Input Context given to the application.
An IME fully aware application will handle the Input Context by itself and will display any necessary information given by the Input Context not using the IME window.
IME User InterfaceThe IME User Interface includes the IME window, the UI window, and the components of the UI window.
FeaturesAn IME class is a predefined global class that carries out any user interface portion of the IME. The normal characteristics of an IME class are the same as with other common controls. Its window instance can be created by CreateWindowEx. As with static controls, the IME class window does not respond to user input by itself, but receives various types of control messages to realize the entire user interface of the IME. An application can create its own IME window(s) by using this IME class or by obtaining the Default IME window through ImmGetDefaultIMEWnd. In comparison to Windows 3.1, an application that wants to control the IME with these window handles (an IME-aware application) can now achieve the following benefits:
  • The new IME includes candidates listing windows. Each application can have its own window instance of the UI so a user can stop in the middle of any operation to switch to another application. In the Windows 3.1 Japanese Edition, the user had to first exit an operation before switching to another application.
  • Since the IME User Interface window is informed about an application’s window handle, it can provide several default behaviors for the application. For example, this can include automatic repositioning of the IME window, automatic tracing of the window caret position, and mode indication for each application.
Even though the system provides only one IME class, there are two kinds of IME window. One is created by the system for the DefWindowProc function especially for an IME unaware program. The IME User Interface for the DefWindowProc function is shared by all IME unaware windows of a thread and is called the default IME window in this documentation. The other windows are created by IME aware applications and are called the application IMEwindow.
Default and Application IME WindowThe system creates a default IME window at thread initialization time, which is given to a thread automatically. This window then handles any IME user interface for an IME unaware application.
When the IME or IMM generates WM_IME_xxx messages, an IME unaware application passes them to DefWindowProc. Then, DefWindowProcB sends necessary messages to the default IME window, which provides default behavior of the IME User Interface for an unaware application. An IME aware application also uses this window when it does not hook messages from the IME. An application can use its own application IME window when it is necessary.
IME ClassThe Win32 systems provides an IME class in the system. This class is defined by the user just as the predefined Edit class is. The system IME class handles the entire UI of the IME and handles entire control messages from the IME and application, including IMM functions. An application can create its own IME User Interface by using this class. The system IME class, itself, is not replaced by any IME, but is kept as a predefined class.
This class has a window procedure that actually handles the WM_IME_SELECT message. This message has the hKL of the newly selected IME. The system IME class retrieves the name of the class defined by each IME with this hKL. Using this name, the system IME class creates a UI window of the currently active IME.
UI Class from IME In this design, every IME is expected to register its own UI class for the system. The UI class provided by each IME should be responsible for IME-specific functionality. The IME may register the classes that are used by the IME itself when the IME is attached to the process. This occurs when DllEntry is called with DLL_PROCESS_ATTACH. The IME then has to set the UI class name in the lpszClassName parameter, which is the second parameter of ImeInquire.
The UI class should be registered with CS_IME specified in the style field so every application can use it through the IME class. The UI class name (including the null terminator) can consist of up to 16 characters and may be increased in future versions.
The cbWndExtra of the UI class has to be 2 * sizeof(LONG). The purpose of this WndExtra is defined by the system (for example, IMMGWL_IMC and IMMGWL_PRIVATE).
The IME can register any class and create any window while working in an application.
The following sample shows how to register the IME User Interface Class:
  1. BOOL WINAPI DLLEntry (
  2.     HINSTANCE    hInstDLL,
  3.     DWORD        dwFunction,
  4.     LPVOID       lpNot)
  5. {
  6. switch(dwFunction)
  7.     {
  8. case DLL_PROCESS_ATTACH:
  9. hInst= hInstDLL;
  10.             wc.style          = CS_MYCLASSFLAG | CS_IME;
  11.             wc.lpfnWndProc    = MyUIServerWndProc;
  12.             wc.cbClsExtra     = 0;
  13.             wc.cbWndExtra     = 2 * sizeof(LONG);
  14.             wc.hInstance      = hInst;
  15.             wc.hCursor        = LoadCursor( NULL, IDC_ARROW );
  16.             wc.hIcon          = NULL;
  17.             wc.lpszMenuName   = (LPSTR)NULL;
  18. wc.lpszClassName  = (LPSTR)szUIClassName;
  19. wc.hbrBackground  = NULL;
  20. if( !RegisterClass( (LPWNDCLASS)&wc ) )
  21. return FALSE;
  22.             wc.style          = CS_MYCLASSFLAG | CS_IME;
  23.             wc.lpfnWndProc    = MyCompStringWndProc;
  24.             wc.cbClsExtra     = 0;
  25.             wc.cbWndExtra     = cbMyWndExtra;
  26.             wc.hInstance      = hInst;
  27.             wc.hCursor        = LoadCursor( NULL, IDC_ARROW );
  28.             wc.hIcon          = NULL;
  29.             wc.lpszMenuName   = (LPSTR)NULL;
  30. wc.lpszClassName  = (LPSTR)szUICompStringClassName;
  31. wc.hbrBackground  = NULL;
  32. if( !RegisterClass( (LPWNDCLASS)&wc ) )
  33. return FALSE;
  34. break;
  35. case DLL_PROCESS_DETACH:
  36. UnregisterClass(szUIClassName,hInst);
  37. UnregisterClass(szUICompStringClassName,hInst);
  38. break;
  39.     }
  40. return TRUE;
  41. }
复制代码
UI WindowThe IME windows of the IME class are created by the application or by the system. When the IME window is created, the UI window provided by the IME itself is created and owned by the IME window.
Each UI window contains the current Input Context. This Input Context can be obtained by calling GetWindowLong with IMMGWL_IMC when the UI window receives a WM_IME_xxx message. The UI window can refer to this Input Context and handles the messages. The Input Context from GetWindowLong with IMMGWL_IMC is available at any time during the UI window procedure, except when handling a WM_CREATE message.
The cbWndExtra of the UI windows cannot be enhanced by the IME. When the IME needs to use the extra byte of the window instance, the UI window uses SetWindowLong and GetWindowLong with IMMGWL_PRIVATE. This IMMGWL_PRIVATE provides a LONG value extra of the window instance. When the UI window needs more than one LONG value extra for private use, the UI window can place a handle for a memory block into the IMMGWL_PRIVATE area.The UI window procedure can use DefWindowProc, but the UI window cannot pass a WM_IME_xxx message to DefWindowProc. Even if the message is not handled by the UI window procedure, the UI window does not pass it to DefWindowProc.
The following sample demonstrates how to allocate and use a block of private memory:
  1. LRESULT UIWndProc (HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
  2. {
  3. HIMC hIMC;
  4. HGLOBAL hMyExtra;

  5. switch(msg){
  6. case WM_CREATE:
  7. // Allocate the memory block for the window instance.
  8. hMyExtra = GlobalAlloc(GHND,size_of_MyExtra);
  9. if (!hMyExtra)
  10. MyError();
  11. // Set the memory handle into IMMGWL_PRIVATE
  12. SetWindowLong(hWnd, IMMGWL_PRIVATE, (LONG)hMyExtra);
  13.                 :
  14.                 :
  15. break;
  16. case WM_IME_xxxx:
  17. // Get IMC;
  18. hIMC = GetWindowLong(hWnd,IMMGWL_IMC);
  19. // Get the memory handle for the window instance.
  20. hMyExtra = GetWindowLong(hWnd, IMMGWL_PRIVATE);
  21. lpMyExtra = GlobalLock(hMyExtra);
  22.                 :
  23.                 :
  24. GlobalUnlock(hMyExtra);
  25. break;
  26.             :
  27.             :

  28. case WM_DESTROY:
  29. // Get the memory handle for the window instance.
  30. hMyExtra = GetWindowLong(hWnd, IMMGWL_PRIVATE);
  31. // Free the memory block for the window instance.
  32. GlobalFree(hMyExtra);
  33. break;

  34. default:
  35. return DefWindowProc(hWnd, msg, wParam, lParam);
  36.     }
  37. }
复制代码
The UI window must perform all tasks by referring to the Input Context that is currently selected. When a window of an application is activated, the UI window receives a message that contains the current Input Context. The UI window then uses that Input Context. Thus, the Input Context must contain all the information needed by the UI window to display the composition window, the status window, and so forth.
The UI window refers to the Input Context, but does not need to update it. However, if the UI window wants to update the Input Context, it should call the IMM functions. Because the Input Context is managed by the IMM, the IMM along with the IME should be notified when the Input Context is changed.
For example, the UI window occasionally needs to change the conversion mode of the Input Context when the user clicks the mouse. At this point, the UI window should call ImmSetConversionMode. The ImmSetConversionMode function creates a notification for NotifyIME and the UI window with WM_IME_NOTIFY. If the UI window wants to change the display of the conversion mode, the UI window should wait for a WM_IME_NOTIFY message.
Components of the UI WindowThe UI window can register and show the composition window and the status window by referring to the current Input Context. The class style of the components of the UI window must include the CS_IME bit. A window instance of the UI window gets information about the composition string, font, and position from the current Input Context.
When a window of the application is getting focused, the system gives the Input Context to this window and sets the current Input Context to the UI window. The system then sends a WM_IME_SETCONTEXT message with the handle of its Input Context to the application. The application then passes this message to the UI window. If current Input Context is replaced by another Input Context, the UI window should repaint the composition window. Any time the current Input Context is changed, the UI window displays a correct composition window. Thus, the status of the IME is assured.
A UI window can create a child window or pop-up window to display its status, composition string, or candidate lists. However, these windows have to be owned by the UI window and created as disabled windows. Any windows that are created by the IME should not get the focus.
IME Input ContextEach window is associated with an IME Input Context. The IMM uses the Input Context to maintain IME status, data, and so forth, and communicate with the IME and with applications.
Default Input ContextBy default, the system creates a default Input Context for each thread. All IME unaware windows of the thread share this context.
Application-Created Input ContextA window of an application can associate its window handle to an Input Context to maintain any status of the IME, including an intermediate composition string. Once an application associates an Input Context to a window handle, the system automatically selects the context whenever the window is activated. In this way, an application is free from complicated in and out focus processing.
Using the Input ContextWhen an application or system creates a new Input Context, the system prepares the new Input Context with the components of the IMC (IMCC). These include hCompStr, hCandInfo, hGuideLine, hPrivate, and hMsgBuf. Basically, the IME does not need to create the Input Context and the components of the Input Context. The IME can change the size of them and lock them to get the pointer for them.
Accessing the HIMCWhen an IME accesses the Input Context, the IME has to call ImmLockIMC to get the pointer of the Input Context. ImmLockIMC increments the IMM lock count for IMC, while ImmUnlockIMC decrements the IMM lock count for IMC.
Accessing the HIMCCWhen an IME accesses a component of the Input Context, the IME has to call ImmLockIMCC to get the pointer of the IMCC. ImmLockIMCC increments the IMM lock count for IMCC, while ImmUnlockIMC decrements the IMM lock count for IMCC. ImmReSizeIMCC can resize the IMCC to the size specified in the input parameter.
On occasion, an IME needs to create a new component in the Input Context. The IME can call ImmCreateIMCC to do so. To destroy a newly created component in the Input Context, the IME can call ImmDestroyIMCC.
The following example shows how to access the IMCC and change the size of a component:
  1. LPINPUTCONTEXT lpIMC;
  2. LPCOMOSITIONSTRING lpCompStr;
  3. HIMCC hMyCompStr;

  4. if (hIMC)    // It is not NULL context.
  5. {
  6. lpIMC = ImmLockIMC(hIMC);
  7. if (!lpIMC)
  8.     {
  9. MyError( “Can not lock hIMC”);
  10. return FALSE;
  11.     }

  12. // Use lpIMC->hCompStr.
  13. lpCompStr = (LPCOMPOSITIONSTRING)ImmLockIMCC(lpIMC->hCompStr);
  14. // Access lpCompStr.
  15. ImmUnlockIMCC(lpIMC->hCompStr);

  16. // ReSize lpIMC->hCompStr.
  17. if (!(hMyCompStr = ImmReSizeIMCC(lpIMC->hCompStr,dwNewSize))
  18.     {
  19. MyError(“Can not resize hCompStr”);
  20. ImmUnlockIMC(hIMC);
  21. return FALSE;
  22.     }
  23. lpIMC->hCompStr = hMyCompStr;
  24. ImmUnlockIMC(hIMC);
  25. }
复制代码
Generating MessagesIMEs need to generate IME messages. When an IME initiates the conversion process, the IME has to generate a WM_IME_STARTCOMPOSITION message. If the IME changes the composition string, the IME has to generate a WM_IME_COMPOSITION message.
There are two ways an IME can generate a message: one is by using the lpdwTransKey buffer provided by ImeToAsciiEx, and the other is by calling ImmGenerateMessage.
Using lpTransMsgList to Generate MessagesEvents initiated by IMEs are realized as generating messages to the window associated with the Input Context. Basically, IMEs use the lpTransMsgList provided by the parameter of ImeToAsciiEx to generate the message. The IMEs put the messages into the lpTransMsgList buffer when ImeToAsciiEx is called.
The buffer specified by lpTransMsgList in the ImeToAsciiEx functionis provided by the system. This function can place messages in this buffer all at one time. The real number of messages that can be placed is given at the first double word of the buffer. However, if the ImeToAsciiEx function wants to generate more messages than the given number, ImeToAsciiEx can put all the messages into hMsgBuf in the Input Context and then return the number of messages.
When the return value of ImeToAsciiEx is larger than the specified value in lpTransMsgList, the system does not pick up the messages from lpTransMsgList. Instead, the system looks up hMsgBuf in the Input Context, which is passed as a parameter of ImeToAsciiEx.
Following is the code sample for ImeToAsciiEx implementation:
  1. UINT
  2.    ImeToAsciiEx(
  3.    uVirKey,
  4.    
  5. uScanCode,
  6.    
  7. lpbKeyState,
  8. lpTransMsgList,
  9.    
  10. fuState,
  11.    hIMC
  12.   ){
  13.     DWORD dwMyNumMsg = 0;

  14. . . .

  15.     // Set the messages that the IME wants to generate.
  16.     pTransMsgList->TransMsg[0].message =msg;
  17.     pTransMsgList->TransMsg[0].wParam = wParam;
  18.     pTransMsgList->TransMsg[0].lParam = lParam;

  19.     // Count the number of the messages that the IME wants to generate.
  20.     dwMyNumMsg++;

  21. . . .

  22.     return dwMyNumMsg;
  23. }
复制代码
Using the Message Buffer to Generate MessagesEven if ImeToAsciiEx is not called, IMEs can still generate the message to the window associated with the Input Context by using the message buffer of the Input Context. This message buffer operates as a handle of a memory block and the IME puts the messages into this memory block. The IME then calls the ImmGenerateMessage function, which sends the messages stored in the message buffer to the proper window.
Following is the code sample for ImmGenerateMessage implementation.
  1. MyGenerateMesage(HIMC hIMC, UINT msg, WPARAM wParam, LPARAMlParam)
  2. {
  3.     LPINPUTCONTEXT lpIMC;
  4.     HGLOBAL hTemp;
  5.         LPTRANSMSG lpTransMsg;
  6. DWORD dwMyNumMsg = 1;
  7.    
  8.     // Lock the Input Context.
  9.     lpIMC = ImmLockIMC(hIMC);
  10.     if (!lpIMC) ….. // Error!
  11. // re-allocate the memory block for the message buffer.
  12. hTemp = ImmReSizeIMCC(lpIMC->hMsgBuf, (lpIMC->dwNumMsgBuf + dwMyNumMsg) * sizeof(TRANSMSG));
  13. if (!hTemp) ….// Error!
  14. lpIMC->hMsgBuf = hTemp;
  15. // Lock the memory for the message buffer.
  16. lpTransMsg = ImmLockIMCC(lpIMC->hMsgBuf);
  17. if (!lpTransMsg) …. // Error!


  18. // Set the messages that the IME wants to generate.
  19. lpTransMsg[lpIMC->dwNumMsg].message = msg;
  20. lpTransMsg[lpIMC->dwNumMsg].wParam = wParam;
  21. lpTransMsg[lpIMC->dwNumMsg].lParam = lParam;

  22. // Set the number of the messages.
  23. lpIMC->dwNumMsgBuf += dwMyNumMsg;


  24. // Unlock the memory for the message buffer and the Input Context.
  25. ImmUnlockIMCC(lpIMC->hMsgBuf);
  26. ImmLockIMC(hIMC);

  27. // Call ImmGenerateMessage function.
  28. ImmGenerateMessage(hIMC);
  29. }
复制代码
WM_IME_COMPOSITION MessageWhen an IME generates a WM_IME_COMPOSITION message, the IME specifies lParam as the GCS bits. The GCS bits then inform the available members of the COMPOSITIONSTRING structure. Even if the IME does not update and a member is available, the IME can set the GCS bits.
When an IME generates a WM_IME_COMPOSITION message, the IME can also change the string attribute and clause information all at once.
ImeSetCompositionStringThe ImeSetCompositionString function is used by applications to manipulate the IME composition string. By specifying different flags, an application can change composition string, attribute, clause, and so forth.
The second parameter of this function, dwIndex, specifies how the composition string should be adjusted in an IME. It includes values such as SCS_SETSTR ,SCS_CHANGEATTR, SCS_CHANGECLAUSE, SCS_QUERYRECONVERTSTRING. Each value represents a specific feature.
ImeSetCompositionString CapabilityWhen an IME does not have the capability of ImeSetCompositionString, it will not specify any SCS capability in the IMEINFO structure. When an IME can handle ImeSetCompositionString, it sets the SCS_COMPSTR bit. If an IME can generate the reading string from the composition string, it will set the SCS_CAP_MAKEREAD bit.
If an IME has SCS_CAP_COMPSTR capability, ImeSetCompositionString will be called. In response to this call, the IME should use the new composition string generated by an application and then generate a WM_IME_COMPOSITION message.
SCS_SETSTRIf dwIndex of ImeSetCompositionString is SCS_SETSTR, the IME can clean up all the COMPOSITIONSTR structures of hIMC.
If necessary, the IME can also update the candidate information and generate the candidate message WM_IME_NOTIFY with the submessage as IMN_OPENCANDIDATE, CHANGECANDIDATE, or IMN_CLOSECANDIDATE.
An IME needs to respond to the application requirement based on different input parameters as follows:
  • If the lpRead parameter of ImeSetCompositonString is available: The IME should create the composition string from the reading string contained in lpRead. The IME then creates the attribute and clause information for both the new composition string and reading string of lpRead. The IME generates a WM_IME_COMPOSITION message with either GCS_COMP or GCS_COMPREAD. On occasion, an IME may finalize the conversion automatically. The IME can then generate a WM_IME_COMPOSITION message with either GCS_RESULT or GCS_RESULTREAD instead of GCS_COMPxxx.
  • If the lpComp parameter of ImeSetCompositonString is available: The IME should create the composition attribute and clause information from the composition string contained in lpComp. The IME then generates a WM_IME_COMPOSITION message with GCS_COMP. If the IME has the capability of SCS_CAP_MAKEREAD, the IME should also make the new reading string at the same time. The IME then generates a WM_IME_COMPOSITION message with either GCS_COMP orGCS_COMPREAD. On occasion, an IME may finalize the conversion automatically. The IME can then generate a WM_IME_COMPOSITION message with either GCS_RESULT or GCS_RESULTREAD instead of GCS_COMPxxx.
  • If both lpRead and lpComp are available: The IME should create the composition string and the reading string accordingly. In this case, the IME does not need to follow lpComp and lpRead completely. If an IME cannot find the relation between lpRead and lpComp specified by the application, it should correct the composition string. The IME can then create the attribute and clause information for both the new composition string and reading string of lpRead. The IME then generates a WM_IME_COMPOSITION message with either GCS_COMP or GCS_COMPREAD. On occasion, the IME may finalize the conversion automatically. The IME can then generate a WM_IME_COMPOSITION message with either GCS_RESULT or GCS_RESULTREAD instead of GCS_COMPxxx.
SCS_CHANGEATTRSCS_CHANGEATTR effects only attribute information. The IME should not update the composition string, the clause information of the composition string, the reading of the composition string, or the clause information of the reading of the composition string.
The IME first has to check whether the new attribute is acceptable or not. It then sets the new attribute in the COMPOSITIONSTRING structure of hIMC. Last, the IME generates a WM_IME_COMPOSITION message.
If necessary, the IME can update the candidate information and generate the candidate messages WM_IME_NOTIFY with the submessage as IMN_OPENCANDIDATE, CHANGECANDIDATE, or IMN_CLOSECANDIDATE of WM_IME_NOTIFY.
For this feature, an IME cannot finalize the composition string.
An IME needs to respond to the application requirement based on different input parameters as follows:
  • If the lpRead parameter of ImeSetCompositonString is available: The IME should follow the new attribute in lpRead and then create a new attribute of the composition string for the current composition string. In this case, the clause information does not change.
    The IME generates a WM_IME_COMPOSITION message with either GCS_COMP or GCS_COMPREAD. If an IME cannot accept the new attribute contained in lpRead, it does not generate any messages and returns FALSE.
  • If the lpComp parameter of ImeSetCompositonString is available: The IME follows the new attribute in lpComp. In this case, the clause information does not change.
    If the capability of the IME has SCS_CAP_MAKEREAD and the reading string is available, the IME should create a new attribute of the reading of the composition string for the current reading of the composition string.
  • If both lpRead and lpComp are available: If the IME can accept the new information, it sets the new information in the COMPOSITION structure of hIMC and generates a WM_IME_COMPOSITION message with either GCS_COMP or GCS_COMPREAD.
SCS_CHANGECLAUSESCS_CHANGECLAUSE effects the string and attribute for both the composition string and the reading of the composition string.
If necessary, an IME can update the candidate information and generate the candidate message WM_IME_NOTIFY with the submessages as IMN_OPENCANDIDATE, CHANGECANDIDATE, or IMN_CLOSECANDIDATE.
An IME needs to respond to the application requirement based on different input parameters. Following are the instances in which an IME cannot finalize the composition string.
  • If the lpRead parameter of ImeSetCompositonString is available: The IME follows the new reading clause information of lpRead and has to correct the attribute of the reading of the composition string. The IME can then update the composition string, the attribute, and the clause information of the composition string. The IME generates a WM_IME_COMPOSITION message with either GCS_COMP or GCS_COMPREAD.
  • If the lpComp parameter of ImeSetCompositonString is available: The IME follows the new clause information and has to correct the composition string and the attribute of the composition string. Then, the IME can update the reading attribute and the clause information of the reading attribute. The IME generates a WM_IME_COMPOSITION message with either GCS_COMPSTR or GCS_COMPREAD.
  • If both lpRead and lpComp are available: If the IME can accept the new information, it sets the new information in the COMPOSITION structure of hIMC and generates a WM_IME_COMPOSITION message with either GCS_COMP or GCS_COMPREAD.
Soft KeyboardSoft Keyboard is a special window displayed by the IME. Because some IMEs have special reading characters, an IME can provide a soft keyboard to display these special reading characters. In this way, the user does not have to remember the reading character for each key. For example, an IME can use bo po mo fo for its reading characters, while another IME can use radicals for its reading characters.
An IME can change the reading characters of keys and notify the user of these key changes, depending on the conversion state. For example, during candidate selection time, an IME can show just the selection keys to the user.
An IME can also create its own user interface for a soft keyboard or use the system predefined soft keyboard. If an IME wants to use the system predefined soft keyboard, it needs to specify UI_CAP_SOFTKBD in the fdwUICaps member of the IMEINFO structure when ImeInquire is called.
An IME needs to call ImmCreateSoftKeyboard to create the soft keyboard window . It can also call ImmShowSoftKeyboard to show or hide the soft keyboard. Because the soft keyboard window is one component of the UI window, the owner should be the UI window as well.
There are different types of soft keyboards. Each one is designed for a specific country/region or special purpose. An IME can change the reading characters on the soft keyboard by using one of two methods: IMC_SETSOFTKBDSUBTYPE or IMC_SETSOFTKBDDATA.
ReconversionReconversion is a new IME function for Windows 98 and Windows 2000. It provides the capability to reconvert a string that is already inserted in an application’s document. Specifically, whatever the string is, an IME is instructed to recognize the string, convert it to the reading or typing information, and then display the candidate list.
New and advanced intelligent IMEs are capable of recognizing and interpreting a complete sentence. When an IME is supplied with better information about a string, such as full sentence and string segmentation, it can accomplish better conversion performance and accuracy. For example, by supplying an entire sentence as opposed to just the reconverted strings, the IME can reconvert the string without having to first convert to reading or typing information.
Editing after the determination is harder than before today. This is because determination will discard most of the information undetermined string had, like reading, phrases, and part of speech. Reconversion will get these information back, making editing after the determination as easier as before the determination. Users will be able to choose different homonym words from candidates, change phrase break and let IME analyze again, and so forth.
The RECONVERTSTRING structure can store the entire sentence and point to the string that will be reconverted by dwStartOffset and dwLen. If dwStartOffset is zero and dwLen is the length of the string, the entire string is reconverted by the IME.
Simple ReconversionThe simplest reconversion is when the target string and the composition string are the same as the entire string. In this case, dwCompStrOffset and dwTargetStrOffset are zero, and dwStrLen, dwCompStrLen, and dwTargetStrLen are the same value. An IME will provide the composition string of the entire string that is supplied in the structure, and will set the target clause by its conversion result.
Normal ReconversionFor an efficient conversion result, the application should provide the RECONVERTSTRING structure with the information string. In this case, the composition string is not the entire string, but is identical to the target string. An IME can convert the composition string by referencing the entire string and then setting the target clause by its conversion result.
Enhanced ReconversionApplications can set a target string that is different from the composition string. The target string (or part of the target string) is then included in a target clause in high priority by the IME. The target string in the RECONVERTSTRING structure must be part of the composition string. When the application does not want to change the user’s focus during the reconversion, the target string should be specified. The IME can then reference it.
IME Cancel ReconversionWhen a user cancels the composition string generated by the reconversion, the IME should determine the original reconverted string. Otherwise, the application will loose the string.
SCS_SETRECONVERTSTRING and SCS_QUERYRECONVERTSTRING FlagsApplications can ask an IME to reconvert the string by calling ImmSetCompositionString. They can use either the SCS_SETSTR flag or the SCS_SETRECONVERTSTRING flag to create a new composition string. However, by using SCS_SETRECONVERTSTRING, the application can pass RECONVERTSTRING to the IME for better conversion efficiency.
Initially, the application should call ImmSetCompositionString with SCS_QUERYRECONVERTSTRING. The selected IME can then adjust the given RECONVERTSTRING structure for appropriate reconversion. The application then calls ImmSetCompositionString with SCS_SETRECONVERTSTRING to request that the IME generate a new composition string. If the application asks the IME to adjust the RECONVERTSTRING structure by calling SCS_QUERYRECONVERTSTRING, efficient reconversion can be accomplished.
SCS_SETRECONVERTSTRING or SCS_QUERYRECONVERTSTRING can be used only for IMEs that have an SCS_CAP_SETRECONVERTSTRING property. This property can be retrieved by using the ImmGetProperty function.
IMR_RECONVERTSTRING and IMR_CONFIRMRECONVERTSTRING MessagesWhen an IME wants to reconvert, it can ask the application to provide the string to be reconverted. For example, when a user presses the Reconversion key or selects the Reconversion button in the IME status window, the IME sends a WM_IME_REQUEST message with IMR_RECONVERTSTRING to get the target string. Initially, the IME needs to send this with NULL lParam in order to get the required size of RECONVERTSTRING. The IME then prepares a buffer to receive the target string and sends the message again with the pointer of the buffer in lParam.
After the application handles IMR_RECONVERTSTRING, the IME may or may not adjust the RECONVERTSTRING structure given by the application. Finally, the IME sends a WM_IME_REQUEST message with IMR_CONFIRMRECONVERTSTRING to confirm the RECONVERTSTRING structure.
If the application returns TRUE for IMR_CONFIRMRECONVERTSTRING, the IME generates a new composition string based on the RECONERTSTRING structure in the IMR_CONFIRMRECONVERTSTRING message. If the application returns FALSE, the IME generates a new composition string based on the original RECONVERTSTRING structure given by the application in the IMR_RECONVERTSTRING message. An IME will not generate a composition string for reconversion before IMR_CONFIRMRECONVERTSTRING.
The given string should not be changed by SCS_QUERYRECONVERTSTRING or IMR_CONFIRMRECONVERTSTRING. An IME can change only CompStrOffset, CompStrLen, TargetStrOffset, and TargetStrLen to re-confirm it.
IME Menu FunctionsThe purpose of this function set is to reduce the IME-related icon in the system task bar. It is a new feature for Windows 98 and Windows 2000.
The Windows system program installs two icons in the task bar when the current hKL is an IME. One icon is the System ML icon that indicates the current keyboard layout in the system task bar. The other is the System Pen icon that shows the IME status of the focused window.
Usually, an IME places an additional icon in the task bar. The context menu for this icon is completely dependent on the IME. Having IME icons in a task bar is a quick way for a user to access an IME’s special functions. However, there are three icons associated with the IME and these additional icons may be more than a user wants to deal with.
If the system provides a way for an IME to insert IME menu items into the System Pen icon, the IME then does not need to add its extra icons to the task bar.
The IMM calls the IME function ImeGetImeMenuItems to get the IME menu items.
An application can use ImmGetImeMenuItems to get an IME’s special menu items, which it can add to its context menu. By calling ImmNotify, the selected items can be processed by the IME.
IME Menu NotificationWhen an application wants to handle an IME’s menu items, it can call ImmNotifyIME. When the menu items added by the IME are selected, NotifyIME is called under the focused thread.
IME Help FileThe IME help file is a new function added into Windows 98 and Windows NT. The right click menu of the System Pen Icon has two menu items. One is the setting for the IME system and is used to change the setting of the selected IME of the focus thread. The other menu item is an online Help file that has never been enabled. Thus, this menu item is always grayed. The purpose of this menu item was to display an IME’s online Help. However, because the system does not provide the IME with a way to specify the name of the IME help file, the system task bar program is not able to display it.
IME_ESC_GETHELPFILENAMEThe IME_ESC_GETHELPFILENAME escape allows an IME to specify its help file name. On return from the function, the (LPTSTR)lpData is the full path file name of an IME’s help file.
If the help content is HTML help format, please make sure the help file extension is .chm so the Windows User knows which help engine to start.
Indicator Manager for IMEBy using a set of messages defined in Windows 98 and Windows 2000, an IME can change the icon and ToolTip string for the System Pen icon on the system task bar.
Indicator WindowAn IME can get the window handle of the indicator by using FindWindow with INDICATOR_CLASS.
  1. // Get the window handle of Indicator.
  2. hwndIndicator = FindWindow(INDICATOR_CLASS, NULL);
  3. if (!hwndIndicator)
  4. {
  5. // There is no indicator window. Tray does not have System Pen icon.
  6. return FALSE;
  7. }
  8. // Call PostMessage to change Pen icon.
  9. PostMessage(hwndIndicator, INIDCM_SETIMEICON, nIconIndex, hMyKL);
复制代码
Note  Due to the internal design requirement in the task bar manager, the IME must use PostMessage for INDICM_xxx messages.
MessagesIMEs can send the following messages to the Indicator window to perform different tasks:
INDICM_SETIMEICON
INDICM_SETIMETOOLTIPS
INDICM_REMOVEDEFAULTMENUITEMS
Windows NT and Windows 2000 IssuesThe following topics primarily describe the special issues related to Windows NT/2000. However, some of these issues may also apply to Windows 98.
IME and Localized Language CompatibilityWindows 2000 has full-featured IME support in any localized language version. That is, an IME can be installed and used with any Windows 2000 language. IME developers should test their IME on these environments. This new feature also requires IME developers to prepare their IME help content to include correct charset and font information so it shows up correctly on different language operating systems.
Also, IME developers should develop Unicode IME for Windows 2000. Unicode IMEs will work with Unicode applications under any system locale. For non-Unicode IMEs, the user must change the system locale to support the same language that the IME supports in order to use them.
Unicode InterfaceAlong with the ANSI version of the IMM/IME interface originally supported by Windows 95, Windows NT and Windows 98 support Unicode interface for the IME. To communicate with the system by Unicode interface, an IME should set the IME_PROP_UNICODE bit of the fdwProperty member of the IMEINFO structure, which is the first parameter of the ImeInquire function. Although ImeInquire is called to initialize the IME for every thread of the application process, the IME is expected to return the same IMEINFO structure on a single system. Windows 98 supports all the Unicode functions, except for ImmIsUIMessage.
Security ConcernsThere are two primary security concerns for Windows NT. One involves named objects and the other involves Winlogon.
Named ObjectsAn IME may want to create various named objects that should be accessed from multiple processes on the local system. Such objects may include file, mutex, or event. Since a process might belong to a different user who is interactively logging onto the system, the default security attribute (created by the system when an IME creates an object with the NULL parameter as the pointer to the security attribute) may not be appropriate for all processes on the local system.
On Windows NT, the first client process of the IME may be the Winlogon process that lets a user log onto the system. Since the Winlogon process belongs to the system account during the log-on session and is alive until the system shuts down, named objects created by the IME with the default security attribute during the log-on session cannot be accessed through other processes belonging to a logged-on user.
WinlogonSince a user in the log-on session has not been granted the access right to the system yet, information provided by an IME’s configuration dialog boxes can create security problems. Even though, the system administrator can configure the system so such an IME cannot be activated on the log-on session. A well-behaved IME should not allow users to open configure dialog boxes if the client process is a Winlogon process. An IME can check if the client process executing a log-on session is a Winlogon process by checking the IME_SYSTEMINFO_WINLOGON bit of the dwSystemInfoFlags parameter of ImeInquire.
IME File Format and Data StructuresThe following topics discuss the IME file format and data structures used by the IME.
IME File FormatAn IME needs to specify the following fields correctly in the version information resource. This includes the fixed file information part and the variable length information part. Please refer to the Microsoft Platform SDK for detailed information on version information resource.
Following are the specific settings the IME file should include:
dwFileOS The dwFileOS should be specified in the root block of the version information. The dwFileOS should be VOS__WINDOWS32 for Windows 95 and Windows NT IMEs. dwFileType The dwFileType should be specified in the root block of the version information. The value is VFT_DRV. dwFileSubtype The dwFileSubtype should be specified in the root block of the version information. The value is VFT2_DRV_INPUTMETHOD. FileDescription The FileDescription is specified in the language-specific block of the version information. This should include the IME name and the version. This string is for display purposes only. Currently, the string length is 32 TCHARS, but may be extended in a future version. ProductName The ProductName is specified in the language-specific block of the version information. Charset ID and Language ID The code page (character set ID) and language ID are specified in the variable information block of the version information resource. If there are many code pages (character set ID) and language IDs are specified in the block, the IME uses the first code page ID to display the text and uses the first language ID for the IME language. The charset ID and language ID must match the IME language instead of the resource language. The file name of IME is 8.3. IME Registry ContentsThe IME HKEY_CURRENT_USER registry contains an Input Method key. The following table describes the contents of this Input Method.
KeyContents
Input MethodThere are four value names: Perpendicular Distance, Parallel Distance, Perpendicular Tolerance, and Parallel Tolerance. The near caret operation IME refers to these values. If these four value names are not present, a near operation IME can set a default value, depending on the IME
Value NameValue Data
Perpendicular DistanceDistance is perpendicular to the text escapement. This is the perpendicular distance (pixels) from the caret position to the composition window without the font height and width. The near caret operation IME will adjust the composition window position according to this value and Parallel Distance. It is in REG_DWORD format.
Parallel DistanceDistance (pixels) is parallel to the text escapement. This is the parallel distance from the caret position to the composition window. It is in REG_DWORD format.
Perpendicular ToleranceTolerance (pixels) is perpendicular to the text escapement. This is the perpendicular distance from the caret position to the composition window. The near caret operation IME will not refresh its composition window if the caret movement is within this tolerance. It is in REG_DWORD format.
Parallel ToleranceTolerance (pixels) is parallel to the text escapement. This is the parallel distance from the caret position to the composition window. It is in REG_DWORD format.

An IME can place the per-user setting into:
Under HKEY_CURRENT_USER\Software\<Company Name>\Windows\CurrentVersion\<IME Name>.
An IME can place the per computer setting into:
Under HKEY_LOCAL_MAACHINE\Software\<Company Name>\Windows\CurrentVersion\<IME Name>.
IMM and IME Data StructuresThe following structures are used for IMM and IME communication. IMEs can access these structures directly, but applications cannot.
INPUTCONTEXTThe INPUTCONTEXT structure is an internal data structure that stores Input Context data.
  1. typedef struct tagINPUTCONTEXT {
  2. HWND  hWnd;
  3. BOOL  fOpen;
  4. POINT  ptStatusWndPos;
  5. POINT  ptSoftKbdPos;
  6. DWORD  fdwConversion;
  7. DWORD  fdwSentence;
  8. union {
  9.             LOGFONTA    A;
  10.             LOGFONTW    W;
  11. } lfFont;
  12. COMPOSITIONFORM  cfCompForm;
  13. CANDIDATEFORM  cfCandForm[4];
  14. HIMCC  hCompStr;
  15. HIMCC  hCandInfo;
  16. HIMCC  hGuideLine
  17. HIMCC  hPrivate;
  18. DWORD  dwNumMsgBuf;
  19. HIMCC  hMsgBuf;
  20. DWORD  fdwInit
  21. DWORD  dwReserve[3];
  22. } INPUTCONTEXT;
复制代码
MembershWnd Window handle that uses this Input Context. If this Input Context has shared windows, this must be the handle of the window that is activated. It can be reset with ImmSetActiveContext. fopen Present status of opened or closed IME. ptStatusWndPos Position of the status window. ptSoftKbdPos Position of the soft keyboard. fdwConversion Conversion mode that will be used by the IME composition engine. fdwSentence Sentence mode that will be used by the IME composition engine. lfFont LogFont structure to be used by the IME User Interface when it draws the composition string. cfCompForm COMPOSITIONFORM structure that will be used by the IME User Interface when it creates the composition window. cfCandForm[4] CANDIDATEFORM structures that will be used by the IME User Interface when it creates the candidate windows. This IMC supports four candidate forms. hCompStr Memory handle that points to the COMPOSITIONSTR structure. This handle is available when there is a composition string. hCandInfo Memory handle of the candidate. This memory block has the CANDIDATEINFO structure and some CANDIDATELIST structures. This handle is available when there are candidate strings. hGuideLine Memory handle of GuideLine. This memory block has the GUIDELINE structure. This handle is available when there is guideline information. hPrivate Memory handle that will be used by the IME for its private data area. dwNumMsgBuf Number of messages that are stored in the hMsgBuf. hMsgBuf Memory block that stores the messages in TRANSMSG format. The size of the buffer should be able to store the dwNumMsgBuf amount of TRANSMSGs. This buffer was previously defined in Windows 95/98 and Windows NT 4.0 IME document as the format as [Message1] [wParam1] [lParam1] {[Message2] [wParam2] [lParam2]{...{...{...}}}}, andall values are double word for Win32 platforms. fdwinit Initialize flag. When an IME initializes the member of the INPUTCONTEXT structure, the IME has to see the bit of this member. The following bits are provided.
BitDescription
INIT_STATUSWNDPOSInitialize ptStatusWndPos.
INIT_CONVERSIONInitialize fdwConversion.
INIT_SENTENCEInitialize fdwSentence.
INIT_LOGFONTInitialize lfFont.
INIT_COMPFORMInitializecfCompForm.
INIT_SOFTKBDPOSInitialize ptSoftKbdPos.

dwReserve[3] Reserved for future use. Note  During a call to ImeToAsciiEx, an IME can generate the messages into the lpdwTransKey buffer. However, if an IME wants to generate the messages to the application, it can store the messages in hMsgBuf and call ImmGenerateMessage. The ImmGenerateMessage function then sends the messages in hMsgBuf to the application.
COMPOSITIONSTRThe COMPOSITIONSTR structure contains the composition information. During conversion, an IME places conversion information into this structure.
  1. typedef struct tagCOMPOSITIONSTR {
  2. DWORD  dwSize;
  3. DWORD  dwCompReadAttrLen;
  4. DWORD  dwCompReadAttrOffset;
  5. DWORD  dwCompReadClsLen;
  6. DWORD  dwCompReadClsOffset;
  7. DWORD  dwCompReadStrLen;
  8. DWORD  dwCompReadStrOffset;
  9. DWORD  dwCompAttrLen;
  10. DWORD  dwCompAttrOffset;
  11. DWORD  dwCompClsLen;
  12. DWORD  dwCompClsOffset;
  13. DWORD  dwCompStrLen;
  14. DWORD  dwCompStrOffset;
  15. DWORD  dwCursorPos;
  16. DWORD  dwDeltaStart;
  17. DWORD  dwResultReadClsLen;
  18. DWORD  dwResultReadClsOffset;
  19. DWORD  dwResultReadStrLen;
  20. DWORD  dwResultReadStrOffset;
  21. DWORD  dwResultClsLen;
  22. DWORD  dwResultClsOffset;
  23. DWORD  dwResultStrLen;
  24. DWORD  dwResultStrOffset;
  25. DWORD  dwPrivateSize;
  26. DWORD  dwPrivateOffset;
  27. } COMPOSITIONSTR;
复制代码
MembersdwSize Memory block size of this structure. dwCompReadAttrLen Length of the attribute information of the reading string of the composition string. dwCompReadAttrOffset Offset from the start position of this structure. Attribute information is stored here. dwCompReadClsLen Length of the clause information of the reading string of the composition string. dwCompReadClsOffset Offset from the start position of this structure. Clause information is stored here. dwCompReadStrLen Length of the reading string of the composition string. dwCompReadStrOffset Offset from the start position of this structure. Reading string of the composition string is stored here. dwCompAttrLen Length of the attribute information of the composition string. dwCompAttrOffset Offset from the start position of this structure. Attribute information is stored here. dwCompClsLen Length of the clause information of the composition string. dwCompClsOffset Offset from the start position of this structure. Clause information is stored here. dwCompStrLen Length of the composition string. dwCompStrOffset Offset from the start position of this structure. The composition string is stored here. dwCursorPos Cursor position in the composition string. dwDeltaStart Start position of change in the composition string. If the composition string has changed from the previous state, the first position of such a change is stored here. dwResultReadClsLen Length of the clause information of the reading string of the result string. dwResultReadClsOffset Offset from the start position of this structure. Clause information is stored here. dwResultRieadStrLen Length of the reading string of the result string. dwResultReadStrOffset Offset from the start position of this structure. Reading string of the result string is stored at this point. dwResultClsLen Length of the clause information of the result string. dwResultClsOffset Offset from the start position of this structure. Clause information is stored here. dwResultStrLen Length of the result string. dwResultStrOffset Offset from the start position of this structure. Result string is stored here. dwPrivateSize Private area in this memory block. dwPrivateOffset Offset from the start position of this structure. Private area is stored here. Note  For Unicode: All dw*StrLen members contain the size in Unicode characters of the string in the corresponding buffer. Other dw*Len and dw*Offset members contain the size in bytes of the corresponding buffer.
The format of the attribute information is a single-byte array and specifies the attribute of string. The following values are provided. Those not listed are reserved.
ValueContent
ATTR_INPUTCharacter currently being entered.
ATTR_TERGET_CONVERTEDCharacter currently being converted (already converted).
ATTR_CONVERTEDCharacter given from the conversion.
ATTR_TERGET_NOTCONVERTEDCharacter currently being converted (yet to be converted).
ATTR_FIXEDCONVERTEDCharacters will not be converted anymore.
ATTR_INPUT_ERRORCharacter is an error character and cannot be converted by the IME.

Following is a description of the content for the values provided in the preceding table.
ContentDescription
Character currently being entered.Character that the user is entering. If this is Japanese, this character is a hiragana, katakana, or alphanumeric character that has yet to be converted by the IME.
Character currently being converted (already converted).Character that has been selected for conversion by the user and converted by the IME.
Character given from conversion.Character which the IME has converted.
Character currently being converted (yet to be converted).Character that has been selected for conversion by the user and not yet converted by the IME. If this is Japanese, this character is a hiragana, katakana, or alphanumeric character that the user has entered.
Character is an error character and cannot be converted by the IME.Character is an error character and the IME cannot convert this character. For example, some consonants cannot be combined.

CommentsThe length of the attribute information is the same as the length of the string. Each byte corresponds to each byte of the string. Even if the string includes DBCS characters, the attribute information has the information bytes of both the lead byte and the second byte.
For Windows NT Unicode, the length of the attribute information is the same as the length in Unicode character counts. Each attribute byte corresponds to each Unicode character of the string.
The format of the clause information is a double-word array and specifies the numbers that indicate the position of the clause. The position of the clause is the position of the composition string, with the clause starting from this position. At the least, the length of information is two double words. This means the length of the clause information is 8 bytes. The first double word has to be zero and is the start position of the first clause. The last double word has to be the length of this string. For example, if the string has three clauses, the clause information has four double words. The first double word is zero. The second double word specifies the start position of the second clause. The third double word specifies the start position of the third clause. The last double word is the length of this string.
For Windows NT Unicode, the position of each clause and the length of the string is counted in Unicode characters.
The dwCursorPos member specifies the cursor position and indicates where the cursor is located within the composition string, in terms of the count of that character. The counting starts at zero. If the cursor is to be positioned immediately after the composition string, this value should be equal to the length of the composition string. In the event there is no cursor, a value of -1 is specified here. If a composition string does not exist, this member is invalid.
For Windows NT Unicode, the cursor position is counted in Unicode characters.
CANDIDATEINFOThe CANDIDATEINFO structure is a header of the entire candidate information. This structure can contain 32 candidate lists at most, and these candidate lists have to be in the same memory block.
  1. typedef struct tagCANDIDATEINFO {
  2. DWORD  dwSize;
  3. DWORD  dwCount;
  4. DWORD  dwOffset[32];
  5. DWORD  dwPrivateSize;
  6. DWORD  dwPrivateOffset;
  7. } CANDIDATEINFO;
复制代码
MembersdwSize Memory block size of this structure. dwCount Number of the candidate lists that are included in this memory block. dwOffset[32] Contents are the offset from the start position of this structure. Each offset specifies the start position of each candidate list. dwPrivateSize Private area in this memory block. dwPrivateOffset Offset from the start position of this structure. The private area is stored here. GUIDELINEThe GUIDELINE structure contains the guideline information that the IME sends out.
  1. typedef struct tagGUIDELINE {
  2. DWORD  dwSize;
  3. DWORD  dwLevel;  // the error level.
  4. // GL_LEVEL_NOGUIDELINE,
  5. // GL_LEVEL_FATAL,
  6. // GL_LEVEL_ERROR,
  7. // GL_LEVEL_WARNNING,
  8. // GL_LEVEL_INFORMATION
  9.     DWORD dwIndex;  // GL_ID_NODICTIONARY and so on.
  10.     DWORD dwStrLen;  // Error Strings, if this is 0, there is no error string.
  11. DWORD  dwStrOffset;
  12. DWORD  dwPrivateSize;
  13. DWORD  dwPrivateOffset;
  14. } GUIDELINE;
复制代码
Note  For Unicode, the dwStrLen member specifies the size in Unicode characters of the error string. Other size parameters such as dwSize dwStrOffset, dwPrivateSize contain values counted in bytes.
MembersdwLevel The dwLevel specifies error level. The following values are provided.
ValueDescription
GL_LEVEL_NOGUIDELINENo guideline present. If the old guideline is shown, the UI should hide the old guideline.
GL_LEVEL_FATALFatal error has occurred. Some data may be lost.
GL_LEVEL _ERRORError has occurred. Handling may not be continued.
GL_LEVEL _WARNINGIME warning to user. Something unexpected has occurred, but the IME can continue handling.
GL_LEVEL _INFORMATIONInformation for the user.

dwIndex The following values are provided.
ValueDescription
GL_ID_UNKNOWNUnknown error. The application should refer to the error string.
GL_ID_NOMODULEIME cannot find the module that the IME needs.
GL_ID_NODICTIONARYIME cannot find the dictionary or the dictionary looks strange.
GL_ID_CANNOTSAVEDictionary or the statistical data cannot be saved.
GL_ID_NOCONVERTIME cannot convert anymore.
GL_ID_TYPINGERRORTyping error. The IME cannot handle this typing.
GL_ID_TOOMANYSTROKETwo many keystrokes for one character or one clause.
GL_ID_READINGCONFLICTReading conflict has occurred. For example, some vowels cannot be combined.
GL_ID_INPUTREADINGIME prompts the user now it is in inputting reading character state.
GL_ID_INPUTRADICALIME prompts the user now it is in inputting radical character state.
GL_ID_INPUTCODEIME prompts the user to input the character code state.
GL_ID_CHOOSECANIDATEIME prompts the user to select the candidate string state.
GL_ID_REVERSECONVERSIONIME prompts the user to provide the information of the reverse conversion. The information of reverse conversion can be obtained through ImmGetGuideLine(hIMC, GGL_PRIVATE. lpBuf, dwBufLen).The information contained in lpBuf is in CANDIDATELIST format.
GL_ID_PRIVATE_FIRSTID located between GL_ID_PRIVATE_FIRST and GL_ID_PRIVATE_LAST is reserved for the IME. The IME can freely use these IDs for its own GUIDELINE.
GL_ID_PRIVATE_LASTID located between GL_ID_PRIVATE_FIRST and GL_ID_PRIVATE_LAST is reserved for the IME. The IME can freely use these IDs for its own GUIDELINE.

dwPrivateSize Private area in this memory block. dwPrivateOffset Offset from the start position of this structure. The private area is stored here. IME Management StructuresThe following topics describe the structures used to manage IMEs.
IMEINFOThe IMEINFO structure is used internally by IMM and IME interfaces.
  1. typedef struct tagIMEInfo {
  2.     DWORD  dwPrivateDataSize;  // The byte count of private data in an IME context.
  3.     DWORD  fdwProperty;  // The IME property bits. See description below.
  4.     DWORD  fdwConversionCaps;  // The IME conversion mode capability bits.
  5.     DWORD  fdwSentenceCaps;  // The IME sentence mode capability.
  6.     DWORD  fdwUICaps;  // The IME UI capability.
  7.     DWORD  fdwSCSCaps;  // The ImeSetCompositionString capability.
  8.     DWORD  fdwSelectCaps;  // The IME inherit IMC capability.
  9. } IIMEINFO;
复制代码
MembersdwPrivateDataSize Byte count of the structure. fdwProperty HIWORD of fdwProperty contains the following bits, which are used by the application.
BitDescription
IME_PROP_AT_CARETBit On indicates that the IME conversion window is at caret position. Bit Off indicates a near caret position operation IME.
IME_PROP_SPECIAL_UIBit On indicates that the IME has a special UI. The IME should set this bit only when it has an nonstandard UI that an application cannot display. Typically, an IME will not set this flag.
IME_PROP_CANDLIST_START_FROM_1Bit ON indicates that the UI of the candidate list string starts from zero or 1. An application can draw the candidate list string by adding the 1, 2, 3, and so on in front of the candidate string.
IME_PROP_UNICODEIf set, the IME is viewed as Unicode IME. System and IME will communicate through Unicode IME interface. If clear, IME will use ANSI interface to communicate with system.
IME_PROP_COMPLETE_ON_
UNSELECT
New property bit defined for Windows 98 and Windows 2000. If set, the IME will complete the composition string when the IME is deactivated. If clear, the IME will cancel the composition string when the IME is deactivated (such as from a keyboard layout change).

The LOWORD of fdwProperty contains the following bits, which are used by the system.
BitDescription
IME_PROP_END_UNLOADBit On indicates that the IME will unload when there is no one using it.
IME_PROP_KBD_CHAR_FIRSTBefore the IME translates the DBCS character, the system first translates the characters by keyboard. This character is passed to the IME as an information aid. No aid information is provided when this bit is off.
IME_PROP_NEED_ALTKEYIME needs the ALT key passed to ImeProcessKey.
IME_PROP_IGNORE_UPKEYSIME does not need the UP key passed to ImeProcessKey.
IME_PROP_ACCEPT_WIDE_VKEYWindows 2000: If set, the IME processes the injected Unicode that came from the SendInput function by using VK_PACKET. If clear, IME might not process the injected Unicode and the injected Unicode might be sent to application directly.


fdwConversionCaps Same definition as the conversion mode. If the relative bit is off, the IME does not have the capability to handle the conversion mode no matter whether the corresponding bit of the conversion mode is on or off.
Conversion modeDescription
IME_CMODE_KATAKANABit On indicates that the IME supports KATAKANA mode. Otherwise, it does not.
IME_CMODE_NATIVEBit On indicates that the IME supports NATIVE mode. Otherwise, it does not.
IME_CMODE_FULLSHAPEBit On indicates that the IME supports full shape mode. Otherwise, it does not.
IME_CMODE_ROMANBit On indicates that the IME supports ROMAN input mode. Otherwise, it does not.
IME_CMODE_CHARCODEBit On indicates that the IME supports CODE input mode. Otherwise, it does not.
IME_CMODE_HANJACONVERTBit On indicates that the IME supports HANJA convert mode. Otherwise, it does not.
IME_CMODE_SOFTKBDBit On indicates that the IME supports soft keyboard mode. Otherwise, it does not.
IME_CMODE_NOCONVERSIONBit On indicates that the IME supports No-conversion mode. Otherwise, it does not.
IME_CMODE_EUDCBit On indicates that the IME the IME supports EUDC mode. Otherwise, it does not.
IME_CMODE_SYMBOLBit On indicates that the IME supports SYMBOL mode. Otherwise, it does not.
IME_CMODE_CHARCODESet to 1 if the IME supports character code input mode, but zero if it does not.
IME_CMODE_FIXEDSet to 1 if the IME supports fixed conversion mode, but zero if not. This mode allows preconversion by the IME, but not full conversion. An example of this is Fixed Conversion Mode with DBCS HIRAGANA ROMAN. Under this mode, the IME can convert key input characters to DBCS HIRAGANA by Roman Conversion. However, it prevents conversion from DBCS HIRAGANA to Kanji characters.

fdwSentenceCaps Same constant definition as the sentence mode. If the relative bit is off, the IME does not have the capability to handle the sentence mode no matter if the corresponding bit of sentence mode is on or off.
Conversion modeDescription
IME_SMODE_PLAURALCLAUSEBit On indicates that the IME supports plural clause sentence mode.
IME_SMODE_SINGLECONVERTBit On indicates that the IME supports single character sentence mode.
IME_SMODE_AUTOMETICBit On indicates that the IME supports automatic sentence mode.
IME_SMODE_PHRASEPREDICTBit On indicates that the IME supports phrase predict sentence mode.
IME_SMODE_CONVERSATIONIME uses conversation mode. This is useful for chat applications. Chat applications can change the sentence mode of the IME to conversation style. This is a new mode for Windows 98 and Windows 2000.

fdwUICaps The fdwUICaps bits specify the UI ability of the IME. The following bits are provided.
BitDescription
UI_CAP_2700UI supported when LogFont escape is zero or 2700.
UI_CAP_ROT90UI supported when LogFont escape is zero, 900, 1800, or 2700.
UI_CAP_ROTANYUI supported with any escape.
UI_CAP_SOFKBDIME uses soft keyboard provided by the system.

fdwSCSCaps The fdwSCSCaps bits specify the SetCompositionString capability that the IME has. The following bits are provided.
BitDescription
SCS_CAP_COMPSTRIME can generate the composition string by SCS_SETSTR.
SCS_CAP_MAKEREADWhen calling ImmSetCompositionString with SCS_SETSTR, the IME can create the reading of the composition string without lpRead. Under the IME that has this capability, the application does not need to set lpRead for SCS_SETSTR.

fdwSelectCaps The fdwSelectCaps capability is for the application. When a user changes the IME, the application can determine if the conversion mode will be inherited or not by checking this capability. If the newly selected IME does not have this capability, the application will not receive the new mode and will have to retrieve the mode again. The following bits are provided.
BitDescription
SELECT_CAP_CONVMODEIME has the capability of inheritance of conversion mode at ImeSelect.
SELECT_CAP_SENTENCEIME has the capability of inheritance of sentence mode at ImeSelect.

Structures Used for IME CommunicationThe following topics describe the structures used for communication with IMEs.
CANDIDATELISTThe CANDIDATELIST structure contains information about a candidate list.
  1. typedef struct tagCANDIDATELIST {
  2.     DWORD  dwSize;  // the size of this data structure.
  3.     DWORD  dwStyle;  // the style of candidate strings.
  4.     DWORD  dwCount;  // the number of the candidate strings.
  5.     DWORD  dwSelection;  // index of a candidate string now selected.
  6.     DWORD  dwPageStart;  // index of the first candidate string show in the candidate window. It maybe varies with page up or page down key.
  7.     DWORD  dwPageSize;  // the preference number of the candidate strings shows in one page.
  8.     DWORD  dwOffset[];  // the start positions of the first candidate strings. Start positions of other (2nd, 3rd, ..) candidate strings are appened after this field. IME can do this by reallocating the hCandInfo memory handle. So IME can access dwOffset[2] (3rd candidate string) or dwOffset[5] (6st candidate string).
  9. // TCHAR  chCandidateStr[];  // the array of the candidate strings.
  10. } CANDIDATELIST;
复制代码
Membersdwsize Size, in bytes, of the structure, the offset array, and all candidate strings. dwStyle Candidate style values. Itcan be one or more of the following values.
ValueMeaning
IME_CAND_UNKNOWNCandidates are in a style other than listed here.
IME_CAND_READCandidates have the same reading.
IME_CAND_CODECandidates are in one code range.
IME_CAND_MEANINGCandidates have the same meaning.
IME_CAND_RADICALCandidates are composed of same radical character.
IME_CAND_STROKESCandidates are composed of same number of strokes.

For the IME_CAND_CODE style, the candidate list has a special structure depending on the value of the dwCount member. If dwCount is 1, the dwOffset member contains a single DBCS character rather than an offset, and no candidate string is provided. If the dwCount member is greater than 1, the dwOffset member contains valid offsets, and the candidate strings are text representations of individual DBCS character values in hexadecimal notation.
dwCount Number of candidate strings. dwSelection Index of the selected candidate string. dwPageStart Index of the first candidate string in the candidate window. This varies as the user presses the Page Up and Page Down keys. dwPageSize Number of candidate strings to be shown in one page in the candidate window. The user can move to the next page by pressing IME-defined keys, such as the Page Up or Page Down key. If this number is zero, an application can define a proper value by itself. dwOffset Offset to the start of the first candidate string, relative to the start of this structure. The offsets for subsequent strings immediately follow this member, forming an array of 32-bit offsets. CommentsThe CANDIDATELIST structure is used for the return of ImmGetCandidateList . The candidate strings immediately follow the last offset in the dwOffset array.
COMPOSITIONFORMThe COMPOSITIONFORM structure is used for IMC_SETCOMPOSITIONWINDOW and IMC_SETCANDIDATEPOS messages.
  1. typedef tagCOMPOSITIONFORM {
  2. DWORD  dwStyle;
  3. POINT  ptCurrentPos;
  4. RECT  rcArea;
  5. }COMPOSITIONFORM;
复制代码
MembersdwStyle Position style. The following values are provided.
ValueMeaning
CFS_DEFAULTMove the composition window to the default position. The IME window can display the composition window outside the client area, such as in a floating window.
CFS_FORCE_POSITIONDisplay the upper-left corner of the composition window at exactly the position given by ptCurrentPos. The coordinates are relative to the upper-left corner of the window containing the composition window and are not subject to adjustment by the IME.
CFS_POINTDisplay the upper-left corner of the composition window at the position given by ptCurrentPos. The coordinates are relative to the upper-left corner of the window containing the composition window and are subject to adjustment by the IME.
CFS_RECTDisplay the composition window at the position given by rcArea. The coordinates are relative to the upper-left of the window containing the composition window.

ptCurrentPos Coordinates of the upper-left corner of the composition window. rcArea Coordinates of the upper-left and lower-right corners of the composition window. CommentsWhen the style of the COMPOSITIONFORM structure is CFS_POINT or CFS_FORCE_POINT, the IME will draw the composition string from the position specified by ptCurrentPos of the COMPOSITIONFORM structure that is given by the application. If the style has CFS_RECT, the composition string will be inside the rectangle specified by rcArea. If not, rcArea will be the client rectangle of the application window.
When the application specifies the composition font, the composition window is rotated as the escapement of the composition font. The direction of the composition string follows the escapement of the font in a composition window. The IME then draws the composition string. Following is an example of this process using various values for the escapement of the composition font:
  • Escapement of the composition font is zero Typically, the escapement of the composition font is zero. When this is the case, ptCurrentPos of the composition form structure points to the left and top of the string. All IMEs support this type.
  • Escapement of the composition font is 2700 This is in the case of a vertical writing. When the application provides the vertical writing, the application can set the 2700 escapement in the composition font set by ImmCompositoinFont. The composition string will then be drawn downward. IMEs that have UI_CAP_2700, UI_CAP_ROT90, or UI_CAP_ROTANY capability will support this type of composition window.
  • Escapement of the composition font is 900 or 1800 IMEs that have UI_CAP_ROT90 or UI_CAP_ROTANY capability will support this type of composition window.
  • Escapement of the composition font is any value IMEs that have UI_CAP_ROTANY capability will support this type of composition window.
Note  UI_CAP_ROT90 and UI_CAPS_ANY are the option for the enhancement of the IME. UI_CAP_2700 is recommended.
CANDIDATEFORMThe CANDIDATEFORM structure is used for IMC_GETCANDIDATEPOS and IMC_SETCANDIDATEPOS messages.
  1. typedef tagCANDIDATEFORM {
  2. DWORD  dwIndex;
  3. DWORD  dwStyle;
  4. POINT  ptCurrentPos;
  5. REC  rcArea;
  6. } CANDIDATEFORM;
复制代码
MembersdwIndex Specifies the ID of the candidate list. Zero is the first candidate list, 1 is the second one, and so on up to 3. dwStyle Specifies CFS_CANDIDATEPOS or CFS_EXCLUDE. For a near-caret IME, the dwStyle also can be CFS_DEFAULT. A near-caret IME will adjust the candidate position according to other UI components, if the dwStyle is CFS_DEFAULT. ptCurrentPos Depends on dwStyle. When dwStyle is CFS_CANDIDATEPOS, ptCurrentPos specifies the recommended position where the candidate list window should be displayed. When dwStyle is CFS_EXCLUDE, ptCurrentPos specifies the current position of the point of interest (typically the caret position). rcArea Specifies a rectangle where no display is allowed for candidate windows in the case of CFS_EXCLUDE. STYLEBUFThe STYLEBUF structure contains the identifier and name of a style.
  1. typedef struct tagSTYLEBUF {
  2. DWORD  dwStyle;
  3. TCHAR  szDescription[32]
  4. } STYLEBUF;
复制代码
MembersdwStyle Style of register word. szDescription Description string of this style. Note  The style of the register string includes IME_REGWORD_STYLE_EUDC. The string is in EUDC range:
IME_REGWORD_STYLE_USER_FIRST and IME_REGWORD_STYLE_USER_LAST.
The constants range from IME_REGWORD_STYLE_USER_FIRST to IME_REGWORD_STYLE_USER_LAST and are for private IME ISV styles. The IME ISV can freely define its own style.
SOFTKBDDATAThe SOFTKBDDATA defines the DBCS codes for each virtual key.
  1. typedef struct tagSOFTKBDDATA {
  2. UINT  uCount;
  3. WORD  wCode[][256]
  4. } SOFTKBDDATA;
复制代码
MembersuCount Number of the 256-word virtual key mapping to the internal code array. wCode[][256] 256-word virtual key mapping to the internal code array. There may be more than one 256-word arrays. Note  It is possible for one type of soft keyboard to use two 256-word arrays. One is for the nonshift state and the other is for the shift state. The soft keyboard can use two internal codes for displaying one virtual key.
RECONVERTSTRINGThe RECONVERTSTRING structure defines the strings for IME reconversion. It is the first item in a memory block that contains the strings for reconversion.
  1. typedef struct _tagRECONVERTSTRING {
  2. DWOPD  dwSize;
  3. DWORD  dwVersion;
  4. DWORD  dwStrLen;
  5. DWORD  dwStrOffset;
  6. DWORD  dwCompStrLen;
  7. DWORD  dwCompStrOffset;
  8. DWORD  dwTargetStrLen;
  9. DWORD  dwTargetStrOffset;
  10. } RECONVERTSTRING;
复制代码
MembersdwSize Memory block size of this structure. dwVersion Reserved by the system. This must be zero. dwStrlen Length of the string that contains the composition string. dwStrOffset Offset from the start position of this structure. The string containing the reconverted words is stored at this point. dwCompStrLen Length of the string that will be the composition string. dwCompStrOffset Offset of the string that will be the composition string. dwTargetStrLen Length of the string that is related to the target clause in the composition string. dwTargetStrOffset Offset of the string that is related to the target clause in the composition string. Note  The RECONVERTSTRING structure is a new structure for Windows 98 and Windows 2000. The dwCompStrOffset and dwTargetOffset members are the relative position of dwStrOffset. For Windows NT Unicode, dwStrLen, dwCompStrLen, and dwTargetStrLen are the TCHAR count, and dwStrOffset, dwCompStrOffset, and dwTargetStrOffset are the byte offset.
CommentsIf an application starts the reconversion process by calling ImmSetCompositionString with SCS_SETRECONVERTSTRING and SCS_QUERYRECONVERTSTRING, the application is then responsible for allocating the necessary memory for this structure as well as the composition string buffer. The IME should not use the memory later. If the IME starts the process, it should allocate the necessary memory for the structure and the composition string buffer.
IMEMENUITEMINFOThe IMEMENUITEMINFO structure contains information about IME menu items.
  1. typedef _tagIMEMENUITEMINFO {
  2. UINT  cbSize;
  3. UINT  fType;
  4. UINT  fState;
  5. UINT  wID;
  6. HBITMAP  hbmpChecked;
  7. HBITMAP  hbmpUnchecked;
  8. DWORD  dwItemData;
  9. TCHAR  szString[48];
  10. HBITMAP  hbmpItem;
  11. } IMEMENUITEMINFO;
复制代码
MemberscbSize Size of the structure in bytes fType Menu item type. This member can be one or more of the following values.
ValueMeaning
IMFT_RADIOCHECKDisplays checked menu items using a radio-button mark instead of a check mark if the hbmpChecked member is NULL.
IMFT_SEPARATORSpecifies that the menu item is a separator. A menu item separator appears as a horizontal dividing line. The hbmpItem and szString members are ignored.
IMFT_SUBMENUSpecifies that the menu item is a submenu.

fState Menu item state. This member can be one or more of the following values.
ValueMeaning
IMFS_CHECKEDChecks the menu item. For more information about checked menu items. See the hbmpChecked member.
IMFS_DEFAULTSpecifies that the menu item is the default. A menu can contain only one default menu item, which is displayed in bold.
IMFS_DISABLEDDisables the menu item so it cannot be selected, but does not gray it out.
IMFS_ENABLEDEnables the menu item so it can be selected. This is the default state.
IMFS_GRAYEDDisables the menu item and grays it out so it cannot be selected.
IMFS_HILITEHighlights the menu item.
IMFS_UNCHECKEDUnchecks the menu item. For more information about unchecked menu items, see the hbmpUnchecked member.
IMFS_UNHILITERemoves the highlight from the menu item. This is the default state.

wID Application-defined 16-bit value that identifies the menu item. hbmpChecked Handle to the bitmap to display next to the item if it is checked. If this member is NULL, a default bitmap is used. If the IMFT_RADIOCHECK type value is specified, the default bitmap is a bullet. Otherwise, it is a check mark. hbmpUnchecked Handle to the bitmap to display next to the item if it is not checked. If this member is NULL, no bitmap is used. dwItemData Application-defined value associated with the menu item. szString Content of the menu item. This member is a null-terminated string. hbmpItem Bitmap handle to display. Note  The IMEMENUITEMINFO structure is a new structure for Windows 98 and Windows 2000. The Unicode version of this structure has the szString member as the WCHAR.
TRANSMSGThe TRANSMSG structure contains transferred message, used by ImeToAsciiEx to receive IME generated message.
  1. typedef _tagTRANSMSG {
  2. UINT  message;
  3. WPARAM  wParam;
  4. LPARAM  lParam;
  5. } TRANSMSG;
复制代码
Membersmessage Specify message identify wParam Specify additional information about the message. The exact meaning depends on the value of the message member. lParam Specify additional information about the message. The exact meaning depends on the value of the message member. Note  This structure is added for future 64-bit Windows NT platform. This structure will be used together with TRANSMSGLIST by ImeToAsciiEx to replace the formerly used LPDWORD lpdwTransBuf. Using this structure will still keep the data in memory with the same offset and keep backward compatible.
TRANSMSGLISTThe TRANSMSGLIST structure contains transferred message list returned from ImeToAsciiEx.
  1. typedef _tagTRANSMSGLIST {
  2. UINT  uMsgCount;
  3. TRANSMSG  TransMsg[1];
  4. } TRANSMSGLIST;
复制代码
MembersuMsgCount Specify the message number in TransMsg array. TransMsg Includes TRANSMSG data array. Note  This structure is added for future 64-bit Windows NT platform. This structure will be used by ImeToAsciiEx to replace the formerly used LPDWORD lpdwTransBuf. Using this structure will still keep the data in memory with the same offset and keep backward compatible.

Built on Friday, April 11, 2003

0 个回复

您需要登录后才可以回帖 登录 | 立即注册
返回顶部