HeaderPane
Main
Hide

SftButton/DLL 3.0 - Button Control

Share Link
Print

GetControlInfo

Retrieve the button's current configuration into a SFTBUTTON_CONTROL structure.

C

BOOL SftButton_GetControlInfo(HWND hwndCtl, LPSFTBUTTON_CONTROL lpCtl);

C++

BOOL CSftButton::GetControlInfo(LPSFTBUTTON_CONTROL lpCtl) const;

Parameters

hwndCtl

The window handle of the button control.

lpCtl

Pointer to a caller-allocated SFTBUTTON_CONTROL structure. The caller must set cbSize to sizeof(SFTBUTTON_CONTROL) before calling.

Return Value

TRUE on success, FALSE on failure (usually an invalid cbSize).

Comments

Use GetControlInfo to read the current state before making targeted changes - populate a local SFTBUTTON_CONTROL from GetControlInfo, modify the fields you care about, then write back with SetControlInfo. This avoids stomping fields you do not set.

Examples

C

        // Apply dark mode to dialog
        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);

See Also SetControlInfo | SFTBUTTON_CONTROL


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