/// <summary> /// Extends the window frame into the client area. /// </summary> /// <param name="hWnd">The handle to the window in which the frame will be extended into the client area.</param> /// <param name="left">The left margin.</param> /// <param name="top">The top margin.</param> /// <param name="right">The right margin.</param> /// <param name="bottom">The bottom margin.</param> /// <returns></returns> public static bool ExtendFrameIntoClientArea(IntPtr hWnd, int left, int top, int right, int bottom) { if (IsPlatformSupported) { MARGINS m = new MARGINS(); m.cxLeftWidth = left; m.cyTopHeight = top; m.cxRightWidth = right; m.cyBottomHeight = bottom; return NativeMethods.DwmExtendFrameIntoClientArea(hWnd, ref m).Succeeded; } return false; }
public static extern HRESULT DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMarInset);