[DllImport("coredll.dll")]
public static extern bool ImmSetOpenStatus(IntPtr hIMC, bool flag);
Declare Function ImmSetOpenStatus Lib "coredll.dll" (TODO) As TODO
None.
Do you know one? Please contribute it!
IME is used to Convert Keyboad input to Local Language.
example Chinese, Japanese, Korean and other.
Please add some!
private static bool setIME(bool mode){
IntPtr hWnd= IntPtr.Zero;
hWnd= GetActiveWindow();
if(hWnd == IntPtr.Zero){
//Can't find ActiveWindow
return false;
}
IntPtr context= IntPtr.Zero;
try{
context= ImmGetContext(hWnd); //get IMEContext
if(mode == true){
//get IMEStatus
//if(ImmGetOpenStatus(IntPtr.Zero)){
// System.Windows.Forms.MessageBox.Show ("IME has be Opened");
//}
// open IME
return ImmSetOpenStatus( context, true ); // IME on
}else
if(mode == false){
//get IMEStatus
//if(ImmGetOpenStatus(IntPtr.Zero)){
// System.Windows.Forms.MessageBox.Show ("IME has be Opened");
//}
// close IME(direct input for Alphabet and Number)
return ImmSetOpenStatus( context, false ); // IME off
}
}finally{
if(context != IntPtr.Zero){
ImmReleaseContext(hWnd, context); //Release IMEContext
}
}
return false;
}