public static void ResetAeroGlass(Margins margins, IntPtr windowHandle) { if (Environment.OSVersion.Version.Major < 6) { throw new PlatformNotSupportedException(); } if (NativeMethods.DwmExtendFrameIntoClientArea(windowHandle, ref margins) != 0) { // throw new InvalidOperationException(); } }