public static extern bool ExtTextOut( IntPtr hdc, int X, int Y, uint fuOptions, [In] ref Telerik.WinControls.NativeMethods.RECT lprc, [MarshalAs(UnmanagedType.LPWStr)] string lpString, uint cbCount, [In] int[] lpDx);
protected virtual void InvalidateNC(Rectangle bounds) { if (!this.Form.IsHandleCreated) { return; } Telerik.WinControls.NativeMethods.RECT rcUpdate = new Telerik.WinControls.NativeMethods.RECT(bounds.Left - this.ClientMargin.Left, bounds.Top - this.ClientMargin.Top, bounds.Right, bounds.Bottom); Telerik.WinControls.NativeMethods.RedrawWindow(new HandleRef((object)this, this.Form.Handle), ref rcUpdate, new HandleRef((object)null, IntPtr.Zero), 1025); }
protected override void WndProc(ref Message m) { if (m.Msg == 532) { Telerik.WinControls.NativeMethods.RECT structure = (Telerik.WinControls.NativeMethods.RECT)Marshal.PtrToStructure(m.LParam, typeof(Telerik.WinControls.NativeMethods.RECT)); this.hostControl.Element.InvalidateMeasure(true); this.hostControl.Element.Measure((SizeF)this.ClientSize); int childMaxWidth = this.hostControl.Element.GetChildMaxWidth(); structure.bottom = structure.top + this.hostControl.Element.Size.Height + this.FormBehavior.ClientMargin.Top + this.FormBehavior.ClientMargin.Bottom; if (structure.right - structure.left < childMaxWidth + this.hostControl.Element.Padding.Left + this.hostControl.Element.Padding.Right) { structure.right = structure.left + childMaxWidth + this.hostControl.Element.Padding.Left + this.hostControl.Element.Padding.Right + this.FormBehavior.ClientMargin.Left + this.FormBehavior.ClientMargin.Right; } Marshal.StructureToPtr((object)structure, m.LParam, true); } base.WndProc(ref m); }
private void OnWMNCPaint(ref Message m) { if (!this.Form.IsHandleCreated) { return; } HandleRef hWnd = new HandleRef((object)this, this.Form.Handle); Telerik.WinControls.NativeMethods.RECT rect = new Telerik.WinControls.NativeMethods.RECT(); if (!Telerik.WinControls.NativeMethods.GetWindowRect(hWnd, ref rect)) { return; } Rectangle rectangle = new Rectangle(0, 0, rect.right - rect.left, rect.bottom - rect.top); if (rectangle.Width <= 0 || rectangle.Height <= 0) { return; } IntPtr zero = IntPtr.Zero; int flags = 19; IntPtr handle = IntPtr.Zero; if (m.WParam != (IntPtr)1) { flags |= 128; handle = m.WParam; } HandleRef hrgnClip = new HandleRef((object)this, handle); IntPtr dcEx = Telerik.WinControls.NativeMethods.GetDCEx(hWnd, hrgnClip, flags); try { if (!(dcEx != IntPtr.Zero)) { return; } using (Graphics graphics = Graphics.FromHdc(dcEx)) this.OnNCPaint(graphics); } finally { Telerik.WinControls.NativeMethods.ReleaseDC(new HandleRef((object)this, m.HWnd), new HandleRef((object)null, dcEx)); } }
private void OnWMNCCalcSize(ref Message m) { if (m.WParam == new IntPtr(1)) { Telerik.WinControls.NativeMethods.NCCALCSIZE_PARAMS nccalcsizeParams = new Telerik.WinControls.NativeMethods.NCCALCSIZE_PARAMS(); Telerik.WinControls.NativeMethods.NCCALCSIZE_PARAMS structure = (Telerik.WinControls.NativeMethods.NCCALCSIZE_PARAMS)Marshal.PtrToStructure(m.LParam, typeof(Telerik.WinControls.NativeMethods.NCCALCSIZE_PARAMS)); Padding clientMargin = this.ClientMargin; if (this.Form.IsMdiChild && this.IsMaximized && !DWMAPI.IsCompositionEnabled) { structure.rgrc[0].top = -clientMargin.Top; } structure.rgrc[0].top += clientMargin.Top; structure.rgrc[0].left += clientMargin.Left; structure.rgrc[0].right -= clientMargin.Right; structure.rgrc[0].bottom -= clientMargin.Bottom; Marshal.StructureToPtr((object)structure, m.LParam, true); m.Result = IntPtr.Zero; } else { this.CallBaseWndProc(ref m); Telerik.WinControls.NativeMethods.RECT rect = new Telerik.WinControls.NativeMethods.RECT(); Telerik.WinControls.NativeMethods.RECT structure = (Telerik.WinControls.NativeMethods.RECT)Marshal.PtrToStructure(m.LParam, typeof(Telerik.WinControls.NativeMethods.RECT)); Padding clientMargin = this.ClientMargin; if (this.Form.IsMdiChild && this.IsMaximized && !DWMAPI.IsCompositionEnabled) { structure.top = -clientMargin.Top; } structure.top += clientMargin.Top; structure.left += clientMargin.Left; structure.right -= clientMargin.Right; structure.bottom -= clientMargin.Bottom; Marshal.StructureToPtr((object)structure, m.LParam, true); m.Result = IntPtr.Zero; } }