HeaderPane
Main
Hide

SftButton/DLL 3.0 - Button Control

Share Link
Print

SFTBUTTON_THEME Constants

Values for the nUseThemes field on SFTBUTTON_CONTROL.

SFTBUTTON_THEME_NO (0)Themes are not honored. The control paints its background, border and text using caller-supplied colors / fonts.
SFTBUTTON_THEME_YES (1)Themes are fully honored. Windows paints the background and border; text color and font come from the theme.
SFTBUTTON_THEME_YES_NOTEXT (2)Themes are honored for background and border only. The caller-supplied text color and font are used.

Themes are automatically suppressed when Dark Mode or Windows High Contrast is active, regardless of the nUseThemes setting.

Examples

C

            if (HIWORD(wParam) == BN_CLICKED)
                MessageBox(hwndDlg, TEXT("Button 3 clicked!"), TEXT("SftButton/DLL"), MB_OK);
            else if (HIWORD(wParam) == SFTBUTTONN_DROPDOWNCLICK)
                MessageBox(hwndDlg, TEXT("Button 3 drop-down clicked!"), TEXT("SftButton/DLL"), MB_OK);
            return TRUE;
        case IDC_USE_THEMES:
            if (HIWORD(wParam) == BN_CLICKED) {
                int useThemes = IsDlgButtonChecked(hwndDlg, IDC_USE_THEMES) == BST_CHECKED
                              ? SFTBUTTON_THEME_YES : SFTBUTTON_THEME_NO;
                int ids[] = { IDC_SFTBUTTON1, IDC_SFTBUTTON2, IDC_SFTBUTTON3 };
                for (int i = 0; i < (int)(sizeof(ids) / sizeof(ids[0])); ++i) {
                    HWND hwndBtn = GetDlgItem(hwndDlg, ids[i]);
                    SFTBUTTON_CONTROL Ctl;
                    Ctl.cbSize = sizeof(SFTBUTTON_CONTROL);
                    SftButton_GetControlInfo(hwndBtn, &Ctl);
                    Ctl.nUseThemes = useThemes;

See Also Using Themes | Dark Mode | High Contrast


Last Updated 05/09/2026 - (email)
© 2026 Softel vdm, Inc.