public void SetIMEWindowLocation(int x, int y) { if (Ime.disableIME || this.hIMEWnd == IntPtr.Zero) { return; } Ime.POINT pOINT = new Ime.POINT() { x = x, y = y }; Ime.COMPOSITIONFORM cOMPOSITIONFORM = new Ime.COMPOSITIONFORM() { dwStyle = 2, ptCurrentPos = pOINT, rcArea = new Ime.RECT() }; try { Ime.SendMessage(this.hIMEWnd, 643, new IntPtr(12), cOMPOSITIONFORM); } catch (AccessViolationException accessViolationException) { this.Handle(accessViolationException); } }
private void SetIMEWindowFont(System.Drawing.Font f) { if (Ime.disableIME || this.hIMEWnd == IntPtr.Zero) { return; } if (this.lf == null) { this.lf = new Ime.LOGFONT(); f.ToLogFont(this.lf); this.lf.lfFaceName = f.Name; } try { Ime.SendMessage(this.hIMEWnd, 643, new IntPtr(10), this.lf); } catch (AccessViolationException accessViolationException) { this.Handle(accessViolationException); } }