HeaderPane
Main
Hide

SftMask/DLL 7.0 - Masked Edit Control

Share Link
Print

SetDarkMode

Selects how the masked edit control participates in Windows dark mode.

C

void SftMask_SetDarkMode(HWND hwndCtl, int mode);

C++

void CSftMask::SetDarkMode(int mode);

Parameters

hwndCtl

The window handle of the masked edit control.

mode

The dark mode setting. One of the following values:

SFTMASK_DARKMODE_OFFAlways use the light palette, regardless of the Windows setting. This is the default.
SFTMASK_DARKMODE_ONAlways use the dark palette, regardless of the Windows setting.
SFTMASK_DARKMODE_AUTOFollow the Windows "Choose your mode" setting. The control automatically re-renders when the Windows setting flips.

Comments

SetDarkMode selects whether the masked edit control uses the dark or light color palette. The default is SFTMASK_DARKMODE_OFF, which keeps the control in the light palette regardless of the Windows setting - this preserves visual back-compatibility for applications written before dark mode existed. Applications that want to participate in dark mode should set SFTMASK_DARKMODE_AUTO to follow the Windows "Choose your mode" setting, or maintain their own Light / Dark toggle and switch each control to SFTMASK_DARKMODE_ON / OFF as the toggle changes.

Dark mode covers the edit area, caption, buttons and all popup windows (calendar, calculator, autocomplete).

When the mode is SFTMASK_DARKMODE_AUTO, the control sends SFTMASKN_DARKMODE_CHANGED to its parent window each time the active dark mode state flips so the application can repaint its own surrounding chrome.

Caller-supplied explicit color values remain in effect in every mode - SetDarkMode does not override application-chosen colors.

The dark mode setting can also be set through the nDarkMode field of the SFTMASK_CONTROL structure.

See Also GetDarkMode | IsDarkModeActive | SetHighContrastMode | Dark Mode | Notifications


Last Updated 08/30/2026 - (email)
© 2026 Softel vdm, Inc.