Windows High Contrast 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. SftBox/DLL 6.0 supports this with its high contrast setting.
While high contrast is active, the combo box control:
The high contrast setting has three values (see SetHighContrastMode):
| SFTBOX_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. |
| SFTBOX_HIGHCONTRAST_ON | Always use the system colors, regardless of the Windows High Contrast setting. Useful for testing. |
| SFTBOX_HIGHCONTRAST_AUTO | Follow the Windows High Contrast setting. The control re-renders when the setting changes and sends SFTBOXN_HIGHCONTRAST_CHANGED to the parent window. |
The default is SFTBOX_HIGHCONTRAST_OFF. An application should call SetHighContrastMode with SFTBOX_HIGHCONTRAST_AUTO once when the combo box is created.
GetHighContrastMode returns the current setting. IsHighContrastActive reports whether high contrast rendering is currently in effect; the read-only fHighContrastActive member of the SFTBOX_CONTROL structure reports the same state. The setting is also available as the nHighContrastMode member of the SFTBOX_CONTROL structure (see SetControlInfo).
SFTBOXN_HIGHCONTRAST_CHANGED is sent to the parent window each time the active state changes (SFTBOX_HIGHCONTRAST_AUTO only), so the application can repaint its own user interface to match.
With SFTBOX_HIGHCONTRAST_AUTO, the combo box learns about a change of the Windows setting through the WM_SETTINGCHANGE message. Windows sends this message to top-level windows only, so the parent window of the combo box must forward it to the combo box.
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.