Sample codeTo disable IME for a certain window, an application can call ImmAssociateContext() API as shown below:
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
// to restore IME.
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.
Article ID: 171154 - Last Review: Nov 21, 2006 - Revision: 1