Reference Codebot.Themes.Windows.DarkMode.pas
Part of the Codebot Themes Design package
The Codebot.Themes.Windows.DarkMode unit calls the routines of uxtheme.dll that switch the native controls of Windows 10 1809 and later between their light and dark visual styles. These routines are not documented, so they are found by their ordinals.
DarkModeLoad finds the routines, and returns False on older versions of Windows or when one is missing. SetAppMode sets the mode of the whole program, SetTitleBarDark switches the title bar of a window, ThemeWindow gives one window the dark parts of its visual style, and SetWindowDarkMode does all of this for a window and its child windows. WindowsBuild reads the build number of Windows, and IsComboBoxClass recognizes the classes of combo boxes, including the one the LCL registers.
Items 15 items
| Name | Kind | Line |
|---|---|---|
| AppModeIsDark | function | 43 |
| DarkModeLoad | function | 35 |
| DarkModeReport | function | 37 |
| IsComboBoxClass | function | 48 |
| SetAppMode | procedure | 41 |
| SetTitleBarDark | procedure | 45 |
| SetWindowDarkMode | procedure | 52 |
| ShouldAppsUseDarkMode | function | 39 |
| ThemeWindow | procedure | 50 |
| TPreferredAppMode | enum | 28 |
| pamDefault | enum value | 28 |
| pamAllowDark | enum value | 28 |
| pamForceDark | enum value | 28 |
| pamForceLight | enum value | 28 |
| WindowsBuild | function | 32 |