Returns the number of items in the combo box control.
C
LONG WINAPI SftBox_GetCount(HWND hwndCtl);
C++
LONG CSftBox::GetCount() const;
hwndCtl
The window handle of the combo box control.
The return value is the number of items in the combo box control.
The GetCount function returns the number of items in the combo box control.
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 */
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