| 33 | } |
| 34 | |
| 35 | void GlassEngine::LoadRegistry(bool redrawNow) |
| 36 | { |
| 37 | UnloadRegistry(); |
| 38 | |
| 39 | GlassService::RequestBuffer content{ GlassService::RequestType::OpenUserRegistry }; |
| 40 | const auto hr = GlassService::SendRequest(content); |
| 41 | if (SUCCEEDED(hr)) |
| 42 | { |
| 43 | if (content.dwmKey) |
| 44 | { |
| 45 | g_dwmKey.reset(content.dwmKey); |
| 46 | } |
| 47 | if (content.personalizeKey) |
| 48 | { |
| 49 | g_personalizeKey.reset(content.personalizeKey); |
| 50 | } |
| 51 | Update(UpdateType::All, redrawNow); |
| 52 | } |
| 53 | } |
| 54 | void GlassEngine::UnloadRegistry() |
| 55 | { |
| 56 | wil::reg::open_unique_key_nothrow(HKEY_LOCAL_MACHINE, L"Software\\Microsoft\\Windows\\DWM", g_dwmKey); |