HeaderPane
Main
Hide

SftTabs/DLL 7.0 Documentation

Share Link
Print

DarkMode

Defines whether the tab control is rendered using a dark color palette.

C

void WINAPI SftTabs_SetDarkMode(HWND hwndCtl, int mode);
int WINAPI SftTabs_GetDarkMode(HWND hwndCtl);
BOOL WINAPI SftTabs_IsDarkModeActive(HWND hwndCtl);

C++

void CSftTabs::SetDarkMode(int mode);
int CSftTabs::GetDarkMode() const;
BOOL CSftTabs::IsDarkModeActive() const;

Parameters

hwndCtl

The window handle of the tab control.

mode

Defines the dark mode setting. mode can be one of the following values:

SFTTABS_DARKMODE_OFFThe tab control is always rendered using the light color palette. This is the default.
SFTTABS_DARKMODE_ONThe tab control is always rendered using the dark color palette, regardless of the Windows system setting.
SFTTABS_DARKMODE_AUTOThe tab control follows the current Windows "Choose your mode" setting (Light / Dark) and switches automatically when the user changes the system setting.

Returns

GetDarkMode returns a value indicating the current dark mode setting (SFTTABS_DARKMODE_OFF, SFTTABS_DARKMODE_ON or SFTTABS_DARKMODE_AUTO).

IsDarkModeActive returns TRUE if the tab control is currently rendering with the dark color palette, otherwise FALSE. When mode is SFTTABS_DARKMODE_AUTO, the return value reflects the current Windows system setting.

Comments

The SetDarkMode, GetDarkMode and IsDarkModeActive functions define and retrieve a tab control's dark mode setting.

Dark mode changes the palette used for the tab control's background, tab labels, active-tab highlight, scroll buttons and close/minimize/restore buttons. Windows themes are suppressed while dark mode is active so the control renders through its built-in dark-aware GDI path rather than the system's light-themed tab style.

When mode is SFTTABS_DARKMODE_AUTO, the tab control tracks WM_SETTINGCHANGE notifications from Windows and re-renders automatically when the user toggles the system Light / Dark setting. A SFTTABSN_DARKMODE_CHANGED notification is sent to the parent window each time the active mode flips so the application can repaint other UI to match.

Caller-supplied color overrides set with SetCtlColors and per-tab colors set in SFTTABS_TAB remain in effect in dark mode unless high contrast mode is also active. Owner-drawn tabs (SFTTABS_DRAWTABPROC) must handle their own dark-mode compliance by reading the current palette from the SFTTABS_DRAWINFO colorBg / colorFg members or by querying IsDarkModeActive.

SetDarkMode is available on Windows 10 and later. On earlier platforms the setting is stored but has no visual effect.

See Also C/C++ API | C++ Classes | Notifications


Last Updated 04/22/2026 - (email)
© 2026 Softel vdm, Inc.