Exemplo n.º 1
0
        private void UpdateAero()
        {
            int en = 0;

            Win32API.MARGINS mg = new Win32API.MARGINS();
            mg.cxLeftWidth = mg.cxRightWidth = mg.cyTopHeight = mg.cyBottomHeight = checkBox1.Left * 2;

            bool transpaerent = false;

            //make sure you are not on a legacy OS
            if (Environment.OSVersion.Version.Major >= 6)
            {
                Win32API.DwmIsCompositionEnabled(ref en);
                //check if the desktop composition is enabled

                if (en > 0)
                {
                    Win32API.DwmExtendFrameIntoClientArea(this.Handle, ref mg);
                    transpaerent = true;
                }
            }

            if (transpaerent)
            {
                BackColor = Color.Black;
            }
            else
            {
                BackColor = DefaultBackColor;
            }
        }
        private void UpdateAero()
        {
            int en = 0;
            Win32API.MARGINS mg = new Win32API.MARGINS();
            mg.cxLeftWidth = mg.cxRightWidth = mg.cyTopHeight = mg.cyBottomHeight = checkBox1.Left * 2;

            bool transpaerent = false;
            //make sure you are not on a legacy OS
            if (Environment.OSVersion.Version.Major >= 6)
            {
                Win32API.DwmIsCompositionEnabled(ref en);
                //check if the desktop composition is enabled

                if (en > 0)
                {
                    Win32API.DwmExtendFrameIntoClientArea(this.Handle, ref mg);
                    transpaerent = true;
                }
            }

            if (transpaerent)
                BackColor = Color.Black;
            else
                BackColor = DefaultBackColor;
        }