//Alexander Klimoff (http://netsources.narod.ru)
// See also MSDN Magazine April 2007
[DllImport("dwmapi.dll", PreserveSig = false)]
public static extern bool DwmIsCompositionEnabled();
// Check to see if composition is Enabled
if (DwmIsCompositionEnabled())
{
MessageBox.Show("Aero Glass enabled");
}
else
{
MessageBox.Show("Aero Glass disabled");
}