To use Aero Glass in my C# application I use
if {DWM.DwmIsCompositionEnabled())
{
Color c = Color.FromArgb(255, 221, 220, 220);
Transparency Key = c;
panel1.BackColor = c;
panel2.BackColor = c;
MARGINS mr = new MARGINS();
mr.T = 1800;
IntPtr h = Handle;
int result = DwmExtendFrameIntoClientArea(h, ref mr);
}
In the designer:
[DllImport("dwmapi.dll")]
public static extern int DwmExtendFrameIntoClientArea(
IntPtr h
ref MARGINS p
};
[StructLayout(LayoutKind.Sequential)]
public strict MARGINS
{
public int T;
}
It works beautifully fine on Windows 7, but on Vista the panels are black instead of transparent. Is Aero Glass on Vista different from the one on 7?
Edit: To the person who -1 this post, because you hate Vista or what? You know as a developer you should make sure that your software runs on as many operating systems as possible to ensure that more people use it.