win64 0.0.25

Hand-crafted, idiomatic Rust wrappers for Win32
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
// A lot of code here is pulled from external sources including, but not limited to, `winit` and StackOverflow.

pub fn is_os_dark_mode() -> bool {
  // based on https://stackoverflow.com/a/70753913

  let key = windows_registry::CURRENT_USER
    .open(r"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize")
    .expect("failed to open registry key");

  let light_theme = key.get_u32("AppsUseLightTheme").expect("failed to read value from registry key");

  light_theme == 0
}