SftBox/DLL 6.0 supports dark mode. By default a combo box control uses the light palette (SFTBOX_DARKMODE_OFF). An application opts in by calling SetDarkMode with SFTBOX_DARKMODE_AUTO, so the control follows the Windows "Choose your mode" setting automatically, or maintains its own Light / Dark setting and switches each control using SFTBOX_DARKMODE_ON and SFTBOX_DARKMODE_OFF.
What changes in dark mode: the static portion, the edit control portion, the dropdown portion with its items, grid lines, selection, column headers and row headers, the border, the dropdown button and the scroll bars all switch to dark-palette colors.
![]() | ![]() |
| Light | Dark |
The dark mode setting has three values (see SetDarkMode):
| SFTBOX_DARKMODE_OFF (default) | Always use the light palette, regardless of the Windows setting. Useful when the application does not yet support dark mode end-to-end and mixing dark and light controls would look wrong. |
| SFTBOX_DARKMODE_ON | Always use the dark palette, regardless of the Windows setting. Useful when the hosting application has its own Light / Dark setting and wants the combo box to follow it. |
| SFTBOX_DARKMODE_AUTO | Follow the Windows "Choose your mode" setting. The control re-renders when the system setting changes and sends SFTBOXN_DARKMODE_CHANGED to the parent window. |
GetDarkMode returns the current setting. IsDarkModeActive reports whether the dark palette is currently in effect; the read-only fDarkModeActive member of the SFTBOX_CONTROL structure reports the same state. The setting is also available as the nDarkMode member of the SFTBOX_CONTROL structure (see SetControlInfo).
SFTBOXN_DARKMODE_CHANGED is sent to the parent window each time the active dark mode state changes (SFTBOX_DARKMODE_AUTO only), so the application can repaint its own user interface around the combo box.
With SFTBOX_DARKMODE_AUTO, the combo box learns about a change of the Windows setting through the WM_SETTINGCHANGE message. Windows sends this message to top-level windows only, so the parent window of the combo box must forward it to the combo box. SftDarkMode_HandleDialogMessage (see below) forwards the message to the direct child windows of a dialog when the Windows dark mode setting changes.
Colors defined by the application (SetCtlColors, column, cell and row header colors) are still honored in dark mode - the control does not override application-chosen colors. Only the default colors, which are based on Windows system colors, are replaced by their dark-palette counterparts. If you need specific cells to stand out in dark mode, pick accent colors that read well on both a light and a dark background (mid-tone saturated values in the RGB 30-210 range tend to work in both), or define the colors again when SFTBOXN_DARKMODE_CHANGED is received.
If Windows themes are used (see Using Themes), the border and the dropdown button are drawn using the dark variant of the Windows theme while dark mode is active.
Dark mode and Windows High Contrast are independent. If both are active, high contrast takes precedence (see High Contrast). IsDarkModeActive still reports the dark mode state in this case.
The combo box follows the dark mode setting at the control level. The hosting dialog itself - title bar, dialog background, static labels, group boxes, edits and any standard Windows controls placed alongside the combo box - also needs to be wired into dark mode for the dialog to render coherently. The shared SftDarkMode helper provides that integration: a single header file (SftDarkMode.h) used by every Softel vdm DLL product, which handles dialog title bars, WM_CTLCOLOR* responses and the Windows "Choose your mode" setting.
A typical adoption is four call sites: SftDarkMode_Init at process startup, SftDarkMode_ApplyToDialog from each WM_INITDIALOG, SftDarkMode_HandleDialogMessage routed from each dialog procedure, and an optional SftDarkMode_SetActive when the application exposes its own Light / Dark setting.
Platform note: Dark mode requires Windows 10 or later.