private void SetCompositionState() { if (QTUtility.IsVista) { if ((0 <= PInvoke.DwmIsCompositionEnabled(out this.fCompositionEnabled)) && this.fCompositionEnabled) { QTTabBarLib.Interop.MARGINS pMarInset = new QTTabBarLib.Interop.MARGINS(); pMarInset.cxLeftWidth = -1; if (0 <= PInvoke.DwmExtendFrameIntoClientArea(base.Handle, ref pMarInset)) { base.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); this.BackColor = Color.Black; return; } } this.BackColor = SystemColors.Menu; } else { base.FormBorderStyle = FormBorderStyle.FixedToolWindow; } base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); }
public static extern int DwmExtendFrameIntoClientArea(IntPtr hWnd, ref MARGINS pMarInset);
private void SetCompositionState() { if(!QTUtility.IsXP) { if((0 <= PInvoke.DwmIsCompositionEnabled(out fCompositionEnabled)) && fCompositionEnabled) { MARGINS pMarInset = new MARGINS(); pMarInset.cxLeftWidth = -1; if(0 <= PInvoke.DwmExtendFrameIntoClientArea(Handle, ref pMarInset)) { SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); BackColor = Color.Black; return; } } BackColor = SystemColors.Menu; } else { FormBorderStyle = FormBorderStyle.FixedToolWindow; } SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); }
private void SetCompositionState() { if(QTUtility.IsVista) { if((0 <= PInvoke.DwmIsCompositionEnabled(out this.fCompositionEnabled)) && this.fCompositionEnabled) { QTTabBarLib.Interop.MARGINS pMarInset = new QTTabBarLib.Interop.MARGINS(); pMarInset.cxLeftWidth = -1; if(0 <= PInvoke.DwmExtendFrameIntoClientArea(base.Handle, ref pMarInset)) { base.SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); this.BackColor = Color.Black; return; } } this.BackColor = SystemColors.Menu; } else { base.FormBorderStyle = FormBorderStyle.FixedToolWindow; } base.SetStyle(ControlStyles.OptimizedDoubleBuffer | ControlStyles.AllPaintingInWmPaint | ControlStyles.UserPaint, true); }