ImmSetOpenStatus (coredll)
Last changed: -211.5.245.142

.
Summary
TODO - a short description

C# Signature:

[DllImport("coredll.dll")]
public static extern bool ImmSetOpenStatus(IntPtr hIMC, bool flag);

VB Signature:

Declare Function ImmSetOpenStatus Lib "coredll.dll" (TODO) As TODO

User-Defined Types:

None.

Alternative Managed API:

Do you know one? Please contribute it!

Notes:

IME is used to Convert Keyboad input to Local Language.

example Chinese, Japanese, Korean and other.

Tips & Tricks:

Please add some!

Sample Code:

     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;
    }

Documentation