public static int SetWindowBorderColors(UInt32 color)
        {
            DwmColorParams colorParams = new DwmColorParams {
                ColorizationColor                    = 0,
                ColorizationAfterglow                = 0x00007fff,
                ColorizationColorBalance             = 0xedd816c5,
                ColorizationAfterglowBalance         = 0x0000002b,
                ColorizationBlurBalance              = 0x6987bf01,
                ColorizationGlassReflectionIntensity = 0,
                ColorizationOpaqueBlend              = 0
            };

            var getRes = DwmpGetColorizationParameters(out colorParams);

            if (getRes != 0)
            {
                return(getRes);
            }

            UInt32 rByte = (UInt32)GetRValue(color) << 16;
            UInt32 gByte = (UInt32)GetGValue(color) << 8;
            UInt32 bByte = GetBValue(color);

            UInt32 dwNewColor = (UInt32)((((UInt32)0xC4) << 24) | (rByte | gByte | bByte));

            colorParams.ColorizationColor     = dwNewColor;
            colorParams.ColorizationAfterglow = dwNewColor;
            var setRes = DwmpSetColorizationParameters(ref colorParams, false);

            return(setRes);
        }
        public static int GetWindowBorderColors(out UInt32 color)
        {
            DwmColorParams colorParams = new DwmColorParams {
                ColorizationColor                    = 0,
                ColorizationAfterglow                = 0,
                ColorizationColorBalance             = 0,
                ColorizationAfterglowBalance         = 0,
                ColorizationBlurBalance              = 0,
                ColorizationGlassReflectionIntensity = 0,
                ColorizationOpaqueBlend              = 0
            };

            var    getRes   = DwmpGetColorizationParameters(out colorParams);
            UInt32 revColor = colorParams.ColorizationColor & 0x00FFFFFF;
            UInt32 curColor = RGB(GetBValue(revColor), GetGValue(revColor), GetRValue(revColor));

            color = curColor;

            return(getRes);
        }
 private static extern int DwmpGetColorizationParameters(out DwmColorParams dcpParams);
 private static extern int DwmpSetColorizationParameters(ref DwmColorParams dcpParams, bool alwaysTrue);