| 194 | } |
| 195 | |
| 196 | bool window::is_dark_theme() |
| 197 | { |
| 198 | char buffer[4]{}; |
| 199 | DWORD cbData = sizeof(buffer); |
| 200 | auto res = _getfunc<decltype(&RegGetValueW)>("advapi32.dll", "RegGetValueW")(HKEY_CURRENT_USER, |
| 201 | L"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize", |
| 202 | L"AppsUseLightTheme", RRF_RT_REG_DWORD, |
| 203 | nullptr, buffer, &cbData); |
| 204 | |
| 205 | if (res != ERROR_SUCCESS) |
| 206 | return false; |
| 207 | |
| 208 | auto i = int(buffer[3] << 24 | |
| 209 | buffer[2] << 16 | |
| 210 | buffer[1] << 8 | |
| 211 | buffer[0]); |
| 212 | |
| 213 | return i != 1; |
| 214 | } |
| 215 | |
| 216 | void window::set_theme(void *hwnd, bool dark) |
| 217 | { |
nothing calls this directly
no outgoing calls
no test coverage detected