CWnd::OnDeleteItem

Syntax

afx_msg void OnDeleteItem( LPDELETEITEMSTRUCT lpDeleteItemStruct );

Parameters

lpDeleteItemStruct

Specifies a long pointer to a DELETEITEMSTRUCT data structure that contains information about the deleted list box item.

Remarks

Called to inform the owner of an owner-draw list box or combo box that the list box or combo box is destroyed or that items are removed by CComboBox::DeleteString, CListBox::DeleteString, CComboBox::ResetContent, or CListBox::ResetContent.

A DELETEITEMSTRUCT data structure has this form:

typedef struct tagDELETEITEMSTRUCT {

WORD CtlType

WORD CtlID;

WORD itemID;

HWND hwndItem;

DWORD itemData;

} DELETEITEMSTRUCT;

Members

CtlType

Contains ODT_LISTBOX (which specifies an owner-draw list box) or ODT_COMBOBOX (which specifies an owner-draw combo box).

CtlID

Contains the control ID for the list box or combo box.

itemID

Contains the index of the item in the list box or combo box being removed.

hwndItem

Contains the window handle of the control.

itemData

Contains the value passed to the control by by CComboBox::AddString, CComboBox::InsertString, CListBox::AddString or CListBox::InsertString.

This message-handler member function calls the Default member function. Override this member function in your derived class to handle the WM_DELETEITEM message.

See Also

CComboBox::DeleteString, CListBox::DeleteString, CComboBox::ResetContent, CListBox::ResetContent, CWnd::Default, WM_DELETEITEM