-
-
Save leha-bot/6fbc0c8b6a79489d4d864400b38a5e44 to your computer and use it in GitHub Desktop.
Windows 10 Aero Undocumented API https://blog.ysc3839.com/archives/2017/10/win10-aero-undocumented-api.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HMODULE hUser = GetModuleHandleA("user32.dll"); | |
if (hUser) | |
{ | |
pfnSetWindowCompositionAttribute setWindowCompositionAttribute = (pfnSetWindowCompositionAttribute)GetProcAddress(hUser, "SetWindowCompositionAttribute"); | |
if (setWindowCompositionAttribute) | |
{ | |
ACCENT_POLICY accent = { ACCENT_ENABLE_BLURBEHIND, 0, 0, 0 }; | |
WINDOWCOMPOSITIONATTRIBDATA data; | |
data.Attrib = WCA_ACCENT_POLICY; | |
data.pvData = &accent; | |
data.cbData = sizeof(accent); | |
setWindowCompositionAttribute(hWnd, &data); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
typedef enum _WINDOWCOMPOSITIONATTRIB | |
{ | |
WCA_UNDEFINED = 0, | |
WCA_NCRENDERING_ENABLED = 1, | |
WCA_NCRENDERING_POLICY = 2, | |
WCA_TRANSITIONS_FORCEDISABLED = 3, | |
WCA_ALLOW_NCPAINT = 4, | |
WCA_CAPTION_BUTTON_BOUNDS = 5, | |
WCA_NONCLIENT_RTL_LAYOUT = 6, | |
WCA_FORCE_ICONIC_REPRESENTATION = 7, | |
WCA_EXTENDED_FRAME_BOUNDS = 8, | |
WCA_HAS_ICONIC_BITMAP = 9, | |
WCA_THEME_ATTRIBUTES = 10, | |
WCA_NCRENDERING_EXILED = 11, | |
WCA_NCADORNMENTINFO = 12, | |
WCA_EXCLUDED_FROM_LIVEPREVIEW = 13, | |
WCA_VIDEO_OVERLAY_ACTIVE = 14, | |
WCA_FORCE_ACTIVEWINDOW_APPEARANCE = 15, | |
WCA_DISALLOW_PEEK = 16, | |
WCA_CLOAK = 17, | |
WCA_CLOAKED = 18, | |
WCA_ACCENT_POLICY = 19, | |
WCA_FREEZE_REPRESENTATION = 20, | |
WCA_EVER_UNCLOAKED = 21, | |
WCA_VISUAL_OWNER = 22, | |
WCA_HOLOGRAPHIC = 23, | |
WCA_EXCLUDED_FROM_DDA = 24, | |
WCA_PASSIVEUPDATEMODE = 25, | |
WCA_USEDARKMODECOLORS = 26, | |
WCA_LAST = 27 | |
} WINDOWCOMPOSITIONATTRIB; | |
typedef struct _WINDOWCOMPOSITIONATTRIBDATA | |
{ | |
WINDOWCOMPOSITIONATTRIB Attrib; | |
PVOID pvData; | |
SIZE_T cbData; | |
} WINDOWCOMPOSITIONATTRIBDATA; | |
typedef enum _ACCENT_STATE | |
{ | |
ACCENT_DISABLED = 0, | |
ACCENT_ENABLE_GRADIENT = 1, | |
ACCENT_ENABLE_TRANSPARENTGRADIENT = 2, | |
ACCENT_ENABLE_BLURBEHIND = 3, | |
ACCENT_ENABLE_ACRYLICBLURBEHIND = 4, // RS4 1803 | |
ACCENT_ENABLE_HOSTBACKDROP = 5, // RS5 1809 | |
ACCENT_INVALID_STATE = 6 | |
} ACCENT_STATE; | |
typedef struct _ACCENT_POLICY | |
{ | |
ACCENT_STATE AccentState; | |
DWORD AccentFlags; | |
DWORD GradientColor; | |
DWORD AnimationId; | |
} ACCENT_POLICY; | |
typedef BOOL (WINAPI *pfnGetWindowCompositionAttribute)(HWND, WINDOWCOMPOSITIONATTRIBDATA*); | |
typedef BOOL (WINAPI *pfnSetWindowCompositionAttribute)(HWND, WINDOWCOMPOSITIONATTRIBDATA*); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment