Many articles I read are polling the registry and so on. Is there no corresponding notification event that can be obtained by C/C++?
Qt or Win32 to obtain notification events for Windows or other systems, users manually switch dark/light mode?
431 views Asked by Jzhang At
1
In Win32, have a native top-level window (which can be hidden) on your main UI thread listening for WM_SETTINGCHANGE and WM_SYSCOLORCHANGE messages. When you get either event, repoll for screen resolution and desktop color settings.
It's not just light-mode and dark mode you want to monitor for. Also be on the lookout if the user enables a "high contrast" mode.
Here's some sample code you can start with: