DwmIsCompositionEnabled

[DllImport("dwmapi.dll", SetLastError = true)]
public static extern int DwmIsCompositionEnabled(
   [MarshalAs(UnmanagedType.Bool)] out bool pfEnabled
);

Microsoft documentation: Linkarrow-up-right

Last updated