HOWTO: Disable IME for a Particular Window

Last reviewed: July 11, 1997
Article ID: Q171154
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface (API) included with: - Microsoft Windows NT version 4.0

SUMMARY

In the Far East versions of Windows 95 and Windows NT 4.0, applications can call ImmAssociateContext() to disable IME for a certain window. Windows 95 and Windows 4.0 now have a new Far East Common API Specification that enables this to would work for the Chinese, Japanese, and Korean versions of Windows 95 and Windows NT 4.0.

MORE INFORMATION

Sample Code

To disable IME for a certain window, an application can call ImmAssociateContext() API as shown below:

      HIMC hIMC;

   hIMC = ImmAssociateContext(hWnd, NULL);   // It makes IME disable for
                                             // hWnd window.

   // Then you can do whatever you want without IME.

   ImmAssociateContext(hWnd, hIMC); // If you want to enable
                                    // IME again, then you can
                                    // use the previous stored IME
                                    // context(hIMC)
                                    // to restore IME.

This method will not work on Windows 3.1 and Windows NT 3.5. You can use WinnlsEnableIME()for these systems, but this function will enable/disable the whole system IME, not just for a specific window.

The reason ImmAssociateContext() does not work on Windows NT 3.51 is that when Microsoft was developing new IMM functions, Windows NT 3.51 was already released with old functionality. Windows NT 3.5 and 3.51 still use Windows 3.1 style IME API like WinnlsEnableIME and SendIMEMessageEx. But, Windows NT 4.0 adapted Windows 95's IME API so that Windows NT 4.0 has the same set of IME API with Windows 95.


Keywords : intlime kbcode kbusage
Version : 4.0
Platform : NT WINDOWS
Issue type : kbhowto


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 11, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.