Exemple #1
0
        public void OpenIME()
        {
            IntPtr hwndInput = IMM.ImmGetContext(IMM.GetActiveWindow());

            IMM.ImmSetOpenStatus(hwndInput, true);
            IntPtr dw1       = IntPtr.Zero;
            IntPtr dw2       = IntPtr.Zero;
            bool   isSuccess = IMM.ImmGetConversionStatus(hwndInput, ref dw1, ref dw2);

            Log.Info("" + hwndInput + "," + isSuccess);
            if (isSuccess)
            {
                int intTemp = dw1.ToInt32() & IME_CMODE_SOFTKBD;
                if (intTemp > 0)
                {
                    dw1 = (IntPtr)(dw1.ToInt32() ^ IME_CMODE_SOFTKBD);
                }
                else
                {
                    dw1 = (IntPtr)(dw1.ToInt32() | IME_CMODE_SOFTKBD);
                }
            }
            isSuccess = IMM.ImmSetConversionStatus(hwndInput, dw1, dw2);
            IMM.ImmReleaseContext(IMM.GetActiveWindow(), hwndInput);
        }
Exemple #2
0
        /// <summary>
        /// Get IME Chinese/English Status
        /// </summary>
        /// <returns></returns>
        public bool getStatus()
        {
            IntPtr dw1 = IntPtr.Zero;
            IntPtr dw2 = IntPtr.Zero;

            return(IMM.ImmGetConversionStatus(Handle, ref dw1, ref dw2));
        }