Home > Software engineering >  IME Microsoft Chinese input keyboard response to an event
IME Microsoft Chinese input keyboard response to an event

Time:10-07

How to close the input method in VC and MFC, urgent!!!!!!!!!!!!!!!!!!!!!!

CodePudding user response:

//load the English keyboard 
HKL m_hHKL=LoadKeyboardLayout (TEXT (" 00000409 "), KLF_ACTIVATE);
If (m_hHKL) {
VERIFY (ActivateKeyboardLayout (m_hHKL KLF_SETFORPROCESS));
}

//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
//
//SetIMEOpenClose ()
//
//This routines calls IMM API to open or close the IME.
//
//* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Void SetIMEOpenClose (HWND HWND, BOOL fFlag) {
HIMC HIMC;
//If fFlag is TRUE then the open IME. FALSE close it.
If (! (hIMC=ImmGetContext (hWnd))) return;
ImmSetOpenStatus (hIMC fFlag);//return 1
ImmReleaseContext (hWnd, hIMC);
}
  • Related