Defines whether the combo box control honors the Windows High Contrast accessibility setting.
C
void WINAPI SftBox_SetHighContrastMode(HWND hwndCtl, int mode); int WINAPI SftBox_GetHighContrastMode(HWND hwndCtl); BOOL WINAPI SftBox_IsHighContrastActive(HWND hwndCtl);
C++
void CSftBox::SetHighContrastMode(int mode); int CSftBox::GetHighContrastMode() const; BOOL CSftBox::IsHighContrastActive() const;
hwndCtl
The window handle of the combo box control.
mode
Defines the high contrast mode setting. mode can be one of the following values:
| SFTBOX_HIGHCONTRAST_OFF | The combo box control ignores the Windows High Contrast setting and renders normally, using the combo box control's colors and themes. This is the default. |
| SFTBOX_HIGHCONTRAST_ON | The combo box control always renders using the Windows system colors, as if Windows High Contrast were active. |
| SFTBOX_HIGHCONTRAST_AUTO | The combo box control follows the current Windows High Contrast accessibility setting and switches automatically when the user changes it. |
GetHighContrastMode returns a value indicating the current high contrast mode setting (SFTBOX_HIGHCONTRAST_OFF, SFTBOX_HIGHCONTRAST_ON or SFTBOX_HIGHCONTRAST_AUTO).
IsHighContrastActive returns TRUE if high contrast rendering is currently in effect, otherwise FALSE. When mode is SFTBOX_HIGHCONTRAST_AUTO, the return value reflects the current Windows accessibility setting.
The SetHighContrastMode, GetHighContrastMode and IsHighContrastActive functions define and retrieve a combo box control's high contrast mode setting. The default is SFTBOX_HIGHCONTRAST_OFF. Applications opt into accessibility tracking with SFTBOX_HIGHCONTRAST_AUTO so the combo box follows the Windows High Contrast setting automatically.
While high contrast rendering is active, colors set by the application (for example using SetCtlColors) are ignored and the system colors of the user's contrast theme are used instead. High contrast takes precedence over dark mode (see SetDarkMode).
The setting applies to all portions of the combo box control. If an invalid mode value is specified, the setting is not changed.
When mode is SFTBOX_HIGHCONTRAST_AUTO, the combo box control re-renders automatically when the user changes the Windows accessibility setting. A SFTBOXN_HIGHCONTRAST_CHANGED notification is sent to the parent window each time the active state changes, so the application can update other parts of its user interface to match.
The high contrast mode setting can also be defined and retrieved using SetControlInfo and GetControlInfo (SFTBOX_CONTROL, nHighContrastMode and the read-only fHighContrastActive).
See Also C/C++ API | Categories | Notifications