Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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;
}
@bryson11
Copy link

bryson11 commented Oct 26, 2017

How to use it ?

@rikka0w0
Copy link

rikka0w0 commented May 8, 2018

My example here, in Chinese but the code itself should be self-explanatory
https://www.kechuang.org/t/79675

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment