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:
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_ON | Always use the system colors, regardless of the Windows High Contrast setting. Useful for testing. |
| SFTDATE_HIGHCONTRAST_AUTO | Follow 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.
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 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.