Win32 Dark Mode enforcer
For stable use, see Dark titlebars enforcing app
This projects demonstrates forcing native Win32 apps to Dark mode
. This requires a lot of work to be stable and universal, so its still a prototype. This is done by combination fo Win32 global hooks
, Win32 Controls subclassing
and some UXtheme API
and also few other things, including undocumented APIs.
For undocumented APIs and structures, credits to: ysc3839/win32-darkmod, rounk-ctrl gist, npp work.
How to try:
- Prepare MS VS2022, Windows 11 22H2 amd64.
- Open
.sln
file with Visual Studio, build in Debug mode. - Switch to Windows 11 Dark theme. Note, that standard
cleanmgr.exe
isn't dark. - Before running DarkEnforcer, save important files, since it will inject
dll
to all processes and something may crash. - Run DarkEnforcer via Visual Studio (without extra elevation/admin rights). It won't show any window, probably. You will see new running process in Task Manager.
- Run standard
cleanmgr.exe
without extra elevation/admin rights. You should see that it's mostly dark now. - When you finished, kill DarkEnforcer process.
Screenshots for MS Windows 11 22H2 cleanmgr.exe, which doesn't support dark mode out-of-the box and was put in dark by the project: