HeaderPane
Main
Hide
Share Link
Print

High Contrast

Windows High Contrast (contrast themes) is an accessibility setting, not a visual preference. Users who enable it have committed to a specific high-contrast color scheme for everything on screen, and Microsoft's accessibility guidelines require applications to let the user's scheme win over any application-chosen colors. SftDate/DLL 2.0 supports this with its high contrast setting.

While high contrast is active, the controls:

  • use the system colors of the user's contrast theme for all their elements, such as COLOR_WINDOW and COLOR_WINDOWTEXT for the field and the days and COLOR_HIGHLIGHT for the selection,
  • ignore the colors defined by the application with SftDate_SetColor, special dates and the NM_SFTDATE_DAYFORMATTING notification - the user's contrast theme wins,
  • outline the day under the mouse instead of filling it, and draw without Windows themes,
  • do not use the dark palette - high contrast takes precedence over dark mode.

The high contrast setting has three values (see SftDate_SetHighContrastMode):

SFTDATE_HIGHCONTRAST_OFF (default)Ignore the Windows High Contrast setting and render normally, using the colors defined by the application. Not recommended for applications which define their own colors - users with accessibility needs will see rendering that does not comply with their contrast theme.
SFTDATE_HIGHCONTRAST_ONAlways use the system colors, regardless of the Windows High Contrast setting. Useful for testing.
SFTDATE_HIGHCONTRAST_AUTOFollow the Windows High Contrast setting. The control redraws when the setting changes and sends NM_SFTDATE_HIGHCONTRAST_CHANGED to its parent window.

The default is SFTDATE_HIGHCONTRAST_OFF. An application should call SftDate_SetHighContrastMode with SFTDATE_HIGHCONTRAST_AUTO once when the control is created.

SftDate_GetHighContrastMode returns the current setting. SftDate_IsHighContrastActive reports whether high contrast rendering is currently in effect.

NM_SFTDATE_HIGHCONTRAST_CHANGED is sent each time the active state changes because of the Windows setting (SFTDATE_HIGHCONTRAST_AUTO only), so the application can repaint its own user interface to match.

Pictures, such as the pictures of special dates, are drawn as defined. Make sure that the pictures used in the calendar remain visible with the user's contrast theme colors.

Following the Windows Setting

With SFTDATE_HIGHCONTRAST_AUTO, the control follows the Windows setting on its own: turning a contrast theme on or off changes the Windows theme, and Windows sends the WM_THEMECHANGED message to every window, the controls included. A WM_SETTINGCHANGE message the parent window forwards to the control (as SftDarkMode_HandleDialogMessage does for dark mode) is handled as well; the NM_SFTDATE_HIGHCONTRAST_CHANGED notification is sent once either way.

Dark Mode

Dark mode and Windows High Contrast are independent. If both are active, high contrast takes precedence - the contrast theme's palette wins over the dark palette, because honoring the user's contrast theme is the stronger accessibility requirement.


Last Updated 11/26/2026 - (email)
© 2026 Softel vdm, Inc.