LB_DELETESTRING
wParam = (WPARAM) index; /* index of string to delete */
lParam = 0L; /* not used, must be zero */
An application sends an LB_DELETESTRING message to delete a string in a list box.
index
Value of wParam. Specifies the zero-based index of the string to delete.
The return value is a count of the strings remaining in the list. The return value is LB_ERR if the index parameter specifies an index greater than the number of items in the list.
If the list box was created with an owner-drawn style but without the LBS_HASSTRINGS style, a WM_DELETEITEM message is sent to the owner of the list box so that the application can free any additional data associated with the item.
This example deletes the first string in a list box:
DWORD dwRemaining;
dwRemaining = SendDlgItemMessage(hdlg, ID_MYLISTBOX,
LB_DELETESTRING, 0, 0L);