We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 23a0293 commit efb5432Copy full SHA for efb5432
1 file changed
shell/common/color_util.cc
@@ -12,6 +12,8 @@
12
13
#if BUILDFLAG(IS_WIN)
14
#include <dwmapi.h>
15
+
16
+#include "base/win/registry.h"
17
#endif
18
19
namespace {
@@ -68,12 +70,18 @@ std::string ToRGBAHex(SkColor color, bool include_hash) {
68
70
69
71
72
std::optional<DWORD> GetSystemAccentColor() {
- DWORD color = 0;
- BOOL opaque = FALSE;
73
+ base::win::RegKey key;
74
+ if (key.Open(HKEY_CURRENT_USER, L"SOFTWARE\\Microsoft\\Windows\\DWM",
75
+ KEY_READ) != ERROR_SUCCESS) {
76
+ return std::nullopt;
77
+ }
78
- if (FAILED(DwmGetColorizationColor(&color, &opaque)))
79
+ DWORD accent_color = 0;
80
+ if (key.ReadValueDW(L"AccentColor", &accent_color) != ERROR_SUCCESS) {
81
return std::nullopt;
- return color;
82
83
84
+ return accent_color;
85
}
86
87
0 commit comments