private void PerformWmPaintWmPrintClient(ref Message m, bool isPaintMessage) { Paintstruct paintstruct1 = new Paintstruct(); IntPtr ptr1 = (isPaintMessage ? User32.BeginPaint(m.HWnd, ref paintstruct1) : m.WParam); RectStruct rect1 = new RectStruct(); User32.GetWindowRect(Handle, ref rect1); Rectangle rectangle1 = new Rectangle(0, 0, rect1.right - rect1.left, rect1.bottom - rect1.top); using (Graphics graphics1 = Graphics.FromHdc(ptr1)) { Bitmap bitmap1 = new Bitmap(rectangle1.Width, rectangle1.Height); using (Graphics graphics2 = Graphics.FromImage(bitmap1)) PerformPaint(new PaintEventArgs(graphics2, rectangle1)); graphics1.DrawImageUnscaled(bitmap1, 0, 0); } if (isPaintMessage) { User32.EndPaint(m.HWnd, ref paintstruct1); } }
internal static extern int GetClipBox(IntPtr hDc, ref RectStruct rectStructBox);
internal static extern IntPtr CreateRectRgnIndirect(ref RectStruct rectStruct);
public static extern bool AdjustWindowRectEx(ref RectStruct lpRectStruct, int dwStyle, bool bMenu, int dwExStyle);
public static extern int MapWindowPoints(IntPtr hWndFrom, IntPtr hWndTo, [In, Out] ref RectStruct rectStruct, int cPoints);
internal static extern bool InvalidateRect(IntPtr hWnd, ref RectStruct rectStruct, bool erase);
internal static extern bool GetWindowRect(IntPtr hWnd, ref RectStruct rectStruct);
public static extern bool GetClientRect(IntPtr hWnd, [In, Out] ref RectStruct rectStruct);
internal static extern bool DrawFocusRect(IntPtr hWnd, ref RectStruct rectStruct);
private void PerformWmPaintWmPrintClient(ref Message m, bool isPaintMessage) { Paintstruct paintstruct1 = new Paintstruct(); IntPtr ptr1 = (isPaintMessage ? User32.BeginPaint(m.HWnd, ref paintstruct1) : m.WParam); RectStruct rect1 = new RectStruct(); User32.GetWindowRect(Handle, ref rect1); Rectangle rectangle1 = new Rectangle(0, 0, rect1.right - rect1.left, rect1.bottom - rect1.top); using (Graphics graphics1 = Graphics.FromHdc(ptr1)) { Bitmap bitmap1 = new Bitmap(rectangle1.Width, rectangle1.Height); using (Graphics graphics2 = Graphics.FromImage(bitmap1)) PerformPaint(new PaintEventArgs(graphics2, rectangle1)); graphics1.DrawImageUnscaled(bitmap1, 0, 0); } if (isPaintMessage) User32.EndPaint(m.HWnd, ref paintstruct1); }