/// <summary> /// Extends the window frame into the client area. /// </summary> /// /// <param name="window"> /// The handle to the window in which the frame will /// be extended into the client area.</param> /// <param name="margins"> /// A pointer to a <see cref="ThemeMargins"/> structure that describes /// the margins to use when extending the frame into the client area.</param> /// public static void ExtendAeroGlassIntoClientArea(IWin32Window window, ThemeMargins margins) { if (window == null) { throw new ArgumentNullException("window"); } NativeMethods.DwmExtendFrameIntoClientArea(window.Handle, ref margins); }
/// <summary> /// Raises the <see cref="E:System.Windows.Forms.Form.Load"/> event. /// </summary> protected override void OnLoad(EventArgs e) { base.OnLoad(e); cbTheora.Bind(b => b.Checked, viewModel, m => m.ToOgg); cbWebM.Bind(b => b.Checked, viewModel, m => m.ToWebM); // Perform special processing to enable aero if (SafeNativeMethods.IsAeroEnabled) { margins = new ThemeMargins(); margins.TopHeight = panel1.Top + 1; margins.LeftWidth = panel1.Left + 1; margins.RightWidth = ClientRectangle.Right - panel1.Right + 1; margins.BottomHeight = ClientRectangle.Bottom - panel1.Bottom + 1; // Extend the Frame into client area SafeNativeMethods.ExtendAeroGlassIntoClientArea(this, margins); } }
internal static extern void DwmExtendFrameIntoClientArea(IntPtr hwnd, ref ThemeMargins margins);
/// <summary> /// Extends the window frame into the client area. /// </summary> /// /// <param name="window"> /// The handle to the window in which the frame will /// be extended into the client area.</param> /// <param name="margins"> /// A pointer to a <see cref="ThemeMargins"/> structure that describes /// the margins to use when extending the frame into the client area.</param> /// public static void ExtendAeroGlassIntoClientArea(IWin32Window window, ThemeMargins margins) { if (window == null) throw new ArgumentNullException("window"); NativeMethods.DwmExtendFrameIntoClientArea(window.Handle, ref margins); }