public static bool ReleaseContext(IntPtr source, IntPtr hIMC) { if (hIMC != IntPtr.Zero) { return(IMENativeWrapper.ImmReleaseContext(source, hIMC)); } return(false); }
public static bool SetCompositionWindow( IntPtr hIMC, RadTextBoxControlElement caretTextBox, Point point) { ImeHelper.SetCompositionFont(caretTextBox, hIMC); return(IMENativeWrapper.ImmSetCompositionWindow(hIMC, ref new IMENativeWrapper.CompositionForm() { dwStyle = 32, ptCurrentPos = { x = Math.Max(0, point.X), y = Math.Max(0, point.Y) } })); }
public static void EnableImmComposition() { if (ImeHelper.threadMgrFailed) { return; } if (ImeHelper.threadMgr == null) { IMENativeWrapper.TF_CreateThreadMgr(out ImeHelper.threadMgr); if (ImeHelper.threadMgr == null) { ImeHelper.threadMgrFailed = true; return; } } ImeHelper.threadMgr.SetFocus(IntPtr.Zero); }
public static string GetImmCompositionString(IntPtr immContext, int dwIndex) { int compositionStringW1 = IMENativeWrapper.ImmGetCompositionStringW(immContext, dwIndex, (StringBuilder)null, 0); if (compositionStringW1 < 0) { return((string)null); } StringBuilder lpBuf = new StringBuilder(compositionStringW1 / 2); int compositionStringW2 = IMENativeWrapper.ImmGetCompositionStringW(immContext, dwIndex, lpBuf, compositionStringW1); if (compositionStringW2 < 0) { return((string)null); } return(lpBuf.ToString().Substring(0, compositionStringW2 / 2)); }
private static void SetCompositionFont(RadTextBoxControlElement caretTextBox, IntPtr hIMC) { double height = (double)caretTextBox.Font.Height; IMENativeWrapper.LOGFONT logfont = new IMENativeWrapper.LOGFONT() { lfHeight = (int)height, lfFaceName = caretTextBox.Font.FontFamily.Name }; IntPtr num = Marshal.AllocHGlobal(Marshal.SizeOf((object)logfont)); try { Marshal.StructureToPtr((object)logfont, num, true); IMENativeWrapper.ImmSetCompositionFontW(hIMC, num); } finally { Marshal.FreeHGlobal(num); } }
public static IntPtr GetDefaultIMEWnd() { return(IMENativeWrapper.ImmGetDefaultIMEWnd(IntPtr.Zero)); }
public static bool NotifyCompositionStringCancel(IntPtr hIMC) { return(IMENativeWrapper.ImmNotifyIME(hIMC, 21, 4, 0)); }
public static IntPtr AssociateContext(NativeWindow source, IntPtr hIMC) { return(IMENativeWrapper.ImmAssociateContext(source.Handle, hIMC)); }
public static IntPtr GetContext(IntPtr source) { return(IMENativeWrapper.ImmGetContext(source)); }