다음을 통해 공유


COMPAREITEMSTRUCT 구조체

The COMPAREITEMSTRUCT structure supplies the identifiers and application-supplied data for two items in a sorted, owner-drawn list box or combo box.

typedef struct tagCOMPAREITEMSTRUCT { 
    UINT   CtlType; 
    UINT   CtlID; 
    HWND   hwndItem; 
    UINT   itemID1; 
    DWORD  itemData1; 
    UINT   itemID2; 
    DWORD  itemData2; 
} COMPAREITEMSTRUCT;

매개 변수

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

  • CtlID
    The control ID for the list box or combo box.

  • hwndItem
    The window handle of the control.

  • itemID1
    The index of the first item in the list box or combo box being compared.

  • itemData1
    Application-supplied data for the first item being compared. This value was passed in the call that added the item to the combo or list box.

  • itemID2
    Index of the second item in the list box or combo box being compared.

  • itemData2
    Application-supplied data for the second item being compared. This value was passed in the call that added the item to the combo or list 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, Windows 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.

요구 사항

Header: winuser.h

참고 항목

참조

CWnd::OnCompareItem

기타 리소스

구조체, 스타일, 콜백 및 메시지 맵