HeaderPane
Main
Hide

SftTabs/DLL 7.0 Documentation

Share Link
Print

HighContrastMode

Defines whether the tab control honors the Windows High Contrast accessibility setting.

C

void WINAPI SftTabs_SetHighContrastMode(HWND hwndCtl, int mode);
int WINAPI SftTabs_GetHighContrastMode(HWND hwndCtl);
BOOL WINAPI SftTabs_IsHighContrastActive(HWND hwndCtl);

C++

void CSftTabs::SetHighContrastMode(int mode);
int CSftTabs::GetHighContrastMode() const;
BOOL CSftTabs::IsHighContrastActive() const;

Parameters

hwndCtl

The window handle of the tab control.

mode

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

SFTTABS_HIGHCONTRAST_OFFThe tab control ignores the Windows High Contrast setting and renders normally, using the tab control's configured colors and themes.
SFTTABS_HIGHCONTRAST_ONThe tab control always renders using the Windows system color palette (COLOR_WINDOW, COLOR_WINDOWTEXT, COLOR_HIGHLIGHT, etc.) as if Windows High Contrast were active.
SFTTABS_HIGHCONTRAST_AUTOThe tab control follows the current Windows High Contrast accessibility setting and switches automatically when the user changes it. This is the default.

Returns

GetHighContrastMode returns a value indicating the current high contrast mode setting (SFTTABS_HIGHCONTRAST_OFF, SFTTABS_HIGHCONTRAST_ON or SFTTABS_HIGHCONTRAST_AUTO).

IsHighContrastActive returns TRUE if high contrast rendering is currently in effect on the tab control, otherwise FALSE. When mode is SFTTABS_HIGHCONTRAST_AUTO, the return value reflects the current Windows accessibility setting.

Comments

The SetHighContrastMode, GetHighContrastMode and IsHighContrastActive functions define and retrieve a tab control's high contrast mode setting. The default is SFTTABS_HIGHCONTRAST_AUTO so accessibility compliance is automatic; applications can opt out with SFTTABS_HIGHCONTRAST_OFF when a fully custom visual design is required.

When high contrast rendering is active, caller-supplied color overrides set with SetCtlColors and per-tab colors are ignored on the default render path. The control instead uses the matching Windows system color (COLOR_WINDOW for backgrounds, COLOR_WINDOWTEXT for text, COLOR_HIGHLIGHT / COLOR_HIGHLIGHTTEXT for the active tab, etc.), complying with Microsoft's High Contrast guidance that the user's chosen contrast theme must not be overridden by the application.

Windows themes are also suppressed in high contrast mode so the control falls back to the non-themed GDI path that honors system colors.

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

Owner-drawn tabs (SFTTABS_DRAWTABPROC) are responsible for their own high contrast compliance. The strict color remap described above applies only to the default render path; owner-draw code should query IsHighContrastActive and re-map its role colors to system-palette values when the return value is TRUE.

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


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