Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save leha-bot/396942f860f60b5f3565ea2441646dba to your computer and use it in GitHub Desktop.
Save leha-bot/396942f860f60b5f3565ea2441646dba to your computer and use it in GitHub Desktop.
C# structures to implement "Aero Glass" blur on Windows 10
[DllImport("user32.dll")]
internal static extern int SetWindowCompositionAttribute(IntPtr hwnd, ref WindowCompositionAttributeData data);
[StructLayout(LayoutKind.Sequential)]
internal struct WindowCompositionAttributeData
{
public WindowCompositionAttribute Attribute;
public IntPtr Data;
public int SizeOfData;
}
internal enum WindowCompositionAttribute
{
// ...
WCA_ACCENT_POLICY = 19
// ...
}
internal enum AccentState
{
ACCENT_DISABLED = 0,
ACCENT_ENABLE_GRADIENT = 1,
ACCENT_ENABLE_TRANSPARENTGRADIENT = 2,
ACCENT_ENABLE_BLURBEHIND = 3,
ACCENT_INVALID_STATE = 4
}
[StructLayout(LayoutKind.Sequential)]
internal struct AccentPolicy
{
public AccentState AccentState;
public int AccentFlags;
public int GradientColor;
public int AnimationId;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment