You send LB_GETCOUNT to get the number of items.
Then send LB_GETTEXT with each index start from 1 to count -1 to get each entry and check the text entry you get back.
If you're using MFC or a similar C++ framework, call the relevant members on the listbox class. For MFC, the class is CListBox, the members are GetCount(), GetText().