It is not that easy to activate and use Dark Theme in Win32 applications with menu and title bar for Windows 11 & 10!Here I have found two open source projects that explain it. Essentially, they are also some of the theme functions that were available in Windows 7 and Vista. What is added is the query for the Aero theme and activation in the menus! 1.) ... Dark Theme in Win32 desktop programs!
|
(Image-1) Dark Theme in Win32 applications with menu and title bar! |
2.) What else needs to be considered and what needs to be done?
The standard buttons can be handled/solved using the C++ theme examples linked above . However, if necessary, you have to make various adjustments to "SysTabControl32", Group-Box and your own controls so that they are displayed in the dark theme!If you do this with the "correct" colors of the dark mode, then you get pretty close to the colors of the dark Windows Explorer.
https://social.msdn.microsoft.com/Forums/en-US/16b70775-d87e-42d3-aa8f-41d7d6888c66/how-to-get-colors-of-default-app-mode-quotdarkquot-in-my-win32-app?forum=windowsgeneraldevelopmentissues
This is a nice demo code to list everything, but what constitutes a real list box, combo box, ... or other things is not documented.
Many programs define this themselves and only work with the public theme API, such as in Chrome, Firefox and Edge, etc. You could also implement the dark mode for Windows 7 yourself and make it switchable on and off via program options. That's all interesting, but it inevitably looks different when you compare it with the system's standard dark theme.
3.) Why is this the case under Windows 11 and 10?
Dark themes have been forgotten to be transferred to Win32, why is the question!
Since Windows 95, it has been possible to set the colors of all elements. Even in Windows XP with a little effort! All programs could read and use these settings.
Since Windows 95, it has been possible to set the colors of all elements. Even in Windows XP with a little effort! All programs could read and use these settings.
The separation of Win32 and UWP came with Windows 8 and the two displays are different! Now there are only two basic designs in Windows 11 and 10, namely light and dark.
Don't forget that you can make good money with such changes!
►► http://www.opengate.at/blog/2021/08/dark-mode-win32/
Don't forget that you can make good money with such changes!
►► http://www.opengate.at/blog/2021/08/dark-mode-win32/
With the Windows 11 / 10 contrast design, the Win32 applications will be able to cope, but there are also some bugs in the system. And the operating system itself makes errors in the display!
msctls_statusbar32, rebarwindow32, toolbarwindow32
(Image-2) Dark Theme in Win32 applications with menu and title bar! |
WM_CTLCOLORMSGBOX, WM_CTLCOLOREDIT, WM_CTLCOLORLISTBOX, WM_CTLCOLORBTN, WM_CTLCOLORDLG, WM_CTLCOLORSCROLLBAR, WM_CTLCOLORSTATIC
FAQ 34: Updated on: 4 September 2024 10:57