Answers for "windows detect dark mode"

0

windows detect system dark mode

RegGetValueA - gets a value from the registry (winreg.h)
use it to retrieve this key:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize\AppsUseLightTheme
res == ERROR_SUCCESS && data == 0 = dark mode
otherwise = light mode (1 is light and fallback should be light)
Posted by: Guest on December-09-2020
0

Detect dark mode

const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
Posted by: Guest on June-13-2021

Code answers related to "Assembly"

Browse Popular Code Answers by Language