typedef struct tagCOMPAREITEMSTRUCT { /* cis */
UINT CtlType;
UINT CtlID;
HWND hwndItem;
UINT itemID1;
DWORD itemData1;
UINT itemID2;
DWORD itemData2;
} COMPAREITEMSTRUCT;
The COMPAREITEMSTRUCT structure supplies the identifiers and application-supplied data for two items in a sorted owner-draw combo box or list box.
Whenever an application adds a new item to an owner-draw combo or list box created with the CBS_SORT or LBS_SORT style, Windows sends the owner a WM_COMPAREITEM message. The lParam parameter of the message contains a long pointer to a COMPAREITEMSTRUCT data structure. When the owner receives the message, the owner compares the two items and returns a value indicating which item sorts before the other.
CtlType
Is ODT_LISTBOX (which specifies an owner-draw list box) or ODT_COMBOBOX (which specifies an owner-draw combo box).
CtlID
Is the control ID for the list box or combo box.
hwndItem
Is the window handle of the control.
itemID1
Is the index of the first item in the list box or combo box being compared.
itemData1
Is application-supplied data for the first item being compared. This value was passed as the lParam parameter of the message that added the item to the combo or list box.
itemID2
Is the index of the second item in the list box or combo box being compared.
itemData2
Is application-supplied data for the second item being compared. This value was passed as the lParam parameter of the message that added the item to the combo or list box.