public static void CreateRegion(IntPtr hWnd, int radius, RoundStyle roundStyle, bool redraw) { var lpRect = new RECT(); NativeMethods.GetWindowRect(hWnd, ref lpRect); var rect = new Rectangle(Point.Empty, lpRect.Size); if (roundStyle != RoundStyle.None) { using (var path = DrawHelper.CreateRoundPath(rect, radius, roundStyle, true)) // { using (var region = new Region(path)) { path.Widen(Pens.White); region.Union(path); var windowDC = NativeMethods.GetWindowDC(hWnd); try { using (var graphics = Graphics.FromHdc(windowDC)) { NativeMethods.SetWindowRgn(hWnd, region.GetHrgn(graphics), redraw); } } finally { NativeMethods.ReleaseDC(hWnd, windowDC); } } return; } } var hRgn = NativeMethods.CreateRectRgn(0, 0, rect.Width, rect.Height); NativeMethods.SetWindowRgn(hWnd, hRgn, redraw); }