computerwhiz
Programmer
I am trying to find the count of items in my listbox and then delete those items but when I retrieve the count I get half of what I should. I have tried both ways of getting the listbox count.
example:
my listbox has 10 entries, the count would come back as 5.
my listbox has 3 entries, the count would come back as 2.
example:
my listbox has 10 entries, the count would come back as 5.
my listbox has 3 entries, the count would come back as 2.
Code:
case IDC_BUTTON3:
{
//UINT cnt = SendMessage(hwndLB,(UINT) LB_GETCOUNT, 0, 0);
DWORD cnt = GetListBoxInfo(hwndLB);
for(int a = 0; a <= cnt-1; a++)
{
SendMessage(hwndLB, LB_DELETESTRING, a, 0);
}
break;
}