PalasoUIWindowsForms/Keyboarding/Windows/WinKeyboardAdaptor.cs
/// <summary>
/// Save the state of the conversion and sentence mode for the current IME
/// so that we can restore it later.
/// </summary>
Save the state of the conversion and sentence mode for the current IME
so that we can restore it later.
Save the state of the conversion and sentence mode for the current IME so that we can restore it later .
private void SaveImeConversionStatus(WinKeyboardDescription winKeyboard)
		{
			if (winKeyboard == null)
				return;
			var windowHandle = new HandleRef(this,
				winKeyboard.WindowHandle != IntPtr.Zero ? winKeyboard.WindowHandle : Win32.GetFocus());
			var contextPtr = Win32.ImmGetContext(windowHandle);
			if (contextPtr == IntPtr.Zero)
				return;
			var contextHandle = new HandleRef(this, contextPtr);
			int conversionMode;
			int sentenceMode;
			Win32.ImmGetConversionStatus(contextHandle, out conversionMode, out sentenceMode);
			winKeyboard.ConversionMode = conversionMode;
			winKeyboard.SentenceMode = sentenceMode;
			Win32.ImmReleaseContext(windowHandle, contextHandle);
		}
private void SaveImeConversionStatus ( WinKeyboardDescription winKeyboard ) { if ( winKeyboard == null ) return ; var windowHandle = new HandleRef ( this , winKeyboard . WindowHandle != IntPtr . Zero ? winKeyboard . WindowHandle : Win32 . GetFocus ( ) ) ; var contextPtr = Win32 . ImmGetContext ( windowHandle ) ; if ( contextPtr == IntPtr . Zero ) return ; var contextHandle = new HandleRef ( this , contextPtr ) ; int conversionMode ; int sentenceMode ; Win32 . ImmGetConversionStatus ( contextHandle , out conversionMode , out sentenceMode ) ; winKeyboard . ConversionMode = conversionMode ; winKeyboard . SentenceMode = sentenceMode ; Win32 . ImmReleaseContext ( windowHandle , contextHandle ) ; }
Save the state of the conversion and sentence mode for the current IME
so that we can restore it later.
Save the state of the conversion and sentence mode for the current IME so that we can restore it later .
winKeyboard
WinKeyboardDescription