From 12beb6c6f5c863059b51c707e8ef7d74acffbc9d Mon Sep 17 00:00:00 2001 From: pit-ray Date: Mon, 12 Feb 2024 05:23:52 +0900 Subject: [PATCH] define DWMWA when win10 system --- include/fluent_tray.hpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/include/fluent_tray.hpp b/include/fluent_tray.hpp index 8af6ff3..819c053 100644 --- a/include/fluent_tray.hpp +++ b/include/fluent_tray.hpp @@ -19,13 +19,17 @@ #include -#if defined(DWMWA_COLOR_DEFAULT) -#define FLUENT_TRAY_DWMWA_AVAIABLE 1 +#ifndef DWMWA_COLOR_DEFAULT +#define DWMWA_WINDOW_CORNER_PREFERENCE static_cast(33) +typedef enum { + DWMWCP_DEFAULT = 0, + DWMWCP_DONOTROUND = 1, + DWMWCP_ROUND = 2, + DWMWCP_ROUNDSMALL = 3 +} DWM_WINDOW_CORNER_PREFERENCE; #endif -#if defined(FLUENT_TRAY_DWMWA_AVAIABLE) #pragma comment(lib, "Dwmapi") -#endif namespace fluent_tray @@ -589,7 +593,6 @@ namespace fluent_tray // Set rounded window for Windows 11 only. if(round_corner) { -#if defined(FLUENT_TRAY_DWMWA_AVAIABLE) auto pref = DWMWCP_ROUND ; if(DwmSetWindowAttribute( hwnd_, @@ -597,7 +600,6 @@ namespace fluent_tray &pref, sizeof(pref)) != S_OK) { return false ; } -#endif } if(!change_icon(icon_path)) {