hi, I’m trying to fix a problem that I can’t find on google or on other platforms, I would like to change the color of the window borders in this case (red) using the api called ‘dwmapi’ I’ve tried many methods but I can’t doing it works.
here is an example of code that I tried to use to change the color of the window.
#define DWMWA_BORDER_COLOR 34
#define DWMWA_CAPTION_COLOR 35
#define DWMWA_TEXT_COLOR 36
DWM_COLORIZATION_PARAMS params;
params.dwColorizationColor = RGB(0, 255, 0);
params.dwColorizationAfterglow = RGB(0, 0, 255);
params.dwColorizationColorBalance = RGB(255, 0, 0);
params.dwAlpha = 255;
params.fOpaque = FALSE;
DwmSetWindowAttribute(hwndHandler, DWMWA_CAPTION_COLOR, ¶ms, sizeof(params));
DwmSetWindowAttribute(hwndHandler, DWMWA_TEXT_COLOR, ¶ms, sizeof(params));
DwmSetWindowAttribute(hwndHandler, DWMWA_BORDER_COLOR, ¶ms, sizeof(params));
BOOL useDarkMode = TRUE;
DwmSetWindowAttribute(hwndHandler, DWMWA_USE_IMMERSIVE_DARK_MODE, &useDarkMode, sizeof(useDarkMode));
the following code I wrote doesn’t work, is there any solution to solve this problem? did I put this code after the glfw window was created or im wrong?
and the variabile DWM_COLORIZATION_PARAMS dosen’t exixt in win32 so i have re-created the function
typedef struct _DWM_COLORIZATION_PARAMS {
DWORD dwColorizationColor;
DWORD dwColorizationAfterglow;
DWORD dwColorizationColorBalance;
DWORD dwAlpha;
BOOL fOpaque;
} DWM_COLORIZATION_PARAMS;