HeaderPane
Main
Hide
Share Link
Print

Count

Returns the number of items in the combo box control.

C

LONG WINAPI SftBox_GetCount(HWND hwndCtl);

C++

LONG CSftBox::GetCount() const;

Parameters

hwndCtl

The window handle of the combo box control.

Returns

The return value is the number of items in the combo box control.

Comments

The GetCount function returns the number of items in the combo box control.

Examples

C View entire sample code

    if (!szCity[0])
        return;

    index = SftBox_FindStringExact(hwndBox, -1, 0, szCity, FALSE);
    if (index > 0)
        index = SftBox_MoveItem(hwndBox, index, 0);
    else if (index < 0) {
        index = SftBox_InsertString(hwndBox, 0, szCity);
        if (SftBox_GetCount(hwndBox) > MAX_HISTORY)
            SftBox_DeleteString(hwndBox, SftBox_GetCount(hwndBox) - 1);
    }
    SftBox_SetCurSel(hwndBox, index);
}

/**********************************************************************/
/*                           Dialog Proc                              */

C++ View entire sample code

    if (city.IsEmpty())
        return;

    index = m_City.FindStringExact(-1, 0, city, FALSE);
    if (index > 0)
        index = m_City.MoveItem(index, 0);
    else if (index < 0) {
        index = m_City.InsertString(0, city);
        if (m_City.GetCount() > MAX_HISTORY)
            m_City.DeleteString(m_City.GetCount() - 1);
    }
    m_City.SetCurSel(index);
}

void CMainDlg::OnOK()
{

See Also C/C++ API | Categories | Notifications


Last Updated 11/21/2026 - (email)
© 2026 Softel vdm, Inc.