Esempio n. 1
0
        /// <summary>
        /// Disable the IME
        /// </summary>
        public void DisableIME()
        {
            IsEnabled = false;

            IMM.DestroyCaret();

            IMM.ImmAssociateContext(Handle, IntPtr.Zero);
        }
Esempio n. 2
0
        /// <summary>
        /// Enable the IME
        /// </summary>
        public void EnableIME()
        {
            IsEnabled = true;

            IMM.DestroyCaret();
            IMM.CreateCaret(Handle, IntPtr.Zero, 1, 1);

            _context = IMM.ImmGetContext(Handle);
            if (_context != IntPtr.Zero)
            {
                IMM.ImmAssociateContext(Handle, _context);
                IMM.ImmReleaseContext(Handle, _context);
                return;
            }

            // This fix the bug that _context is 0 on fullscreen mode.
            ImeContext.Enable(Handle);
        }