/// <summary> /// Extends the frame of the form into the client area /// </summary> /// <param name="margins">The margins that define the frame extention</param> public void ExtendFrameIntoClientArea(Margins margins) { // We check if all margin elements are 0, because that means the extended frame // will be disabled extendedFrame = !((margins.LeftWidth == 0) && (margins.RightWidth == 0) && (margins.TopHeight == 0) && (margins.BottomHeight == 0)); // If Blur Behind is enabled it must be disabled because it is mutually exclusive // with the extended frame. if (enabled && extendedFrame) { // Deactivate Blur Behind SetBlurBehind(false); } // Native API call DwmExtendFrameIntoClientArea(hwnd, ref margins); }
private static extern void DwmExtendFrameIntoClientArea(IntPtr hwnd, ref Margins margins);