HeaderPane
Main
Hide

SftButton/DLL 3.0 - Button Control

Share Link
Print

SetControlInfo

Apply a SFTBUTTON_CONTROL structure to the button, configuring images, colors, text, border, theme and behavior in a single call.

C

BOOL SftButton_SetControlInfo(HWND hwndCtl, LPCSFTBUTTON_CONTROL lpCtl);

C++

BOOL CSftButton::SetControlInfo(LPCSFTBUTTON_CONTROL lpCtl);

Parameters

hwndCtl

The window handle of the button control.

lpCtl

Pointer to a populated SFTBUTTON_CONTROL structure. cbSize must be set to sizeof(SFTBUTTON_CONTROL).

Return Value

TRUE on success. On failure, examine the button's errorValue field through GetControlInfo; see SFTBUTTON_ERR constants for meanings.

Comments

SetControlInfo is the primary way to configure a button. Any field that is left at its default value (zeros, NULL, SFTBUTTON_NOCOLOR, etc.) causes the control to use its default for that aspect. For targeted updates of a single field, use GetControlInfo / modify / SetControlInfo rather than populating a zeroed structure from scratch.

After SetControlInfo, the control invalidates and redraws itself automatically.

Examples

C

        SftDarkMode_ApplyToDialog(hwndDlg);

        // Configure SftButton control 1
        {
            SFTBUTTON_CONTROL Ctl;
            Ctl.cbSize = sizeof(SFTBUTTON_CONTROL);
            SftButton_GetControlInfo(hwndButton1, &Ctl);
            Ctl.nDarkMode = SFTBUTTON_DARKMODE_AUTO;/* automatic dark mode support */
            SftButton_SetControlInfo(hwndButton1, &Ctl);
        }

        // Configure SftButton control 2
        {
            SFTBUTTON_CONTROL Ctl;
            Ctl.cbSize = sizeof(SFTBUTTON_CONTROL);
            SftButton_GetControlInfo(hwndButton2, &Ctl);

See Also GetControlInfo | SFTBUTTON_CONTROL


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