The COMPAREITEMSTRUCT structure supplies the identifiers and application-supplied data for two items in a sorted, owner-drawn list box or combo box.
Whenever an application adds a new item to an owner-drawn list box or combo box created with the CBS_SORT or LBS_SORT style, the system sends the owner a WM_COMPAREITEM message. The lParam parameter of the message contains a long pointer to a COMPAREITEMSTRUCT structure. Upon receiving the message, the owner compares the two items and returns a value indicating which item sorts before the other.
typedef struct tagCOMPAREITEMSTRUCT { // cis
UINT CtlType;
UINT CtlID;
HWND hwndItem;
UINT itemID1;
DWORD itemData1;
UINT itemID2;
DWORD itemData2;
} COMPAREITEMSTRUCT;
This member will be –1 if the item has not been inserted or when searching for a potential item in the list box or combo box.
This member will be –1 if the item has not been inserted or when searching for a potential item in the list box or combo box.
Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Unsupported.
Header: Declared in winuser.h.
Combo Boxes Overview, Combo Box Structures, WM_COMPAREITEM