Prev Next
ListView_SortItems info Overview GroupThe ListView_SortItems macro uses an application-defined comparison function to sort the items of a list view control. The index of each item changes to reflect the new sequence. You can use this macro or explicitly send the LVM_SORTITEMS message. BOOL ListView_SortItems(
Parameters
Return ValuesReturns TRUE if successful or FALSE otherwise. RemarksThe comparison function has the following form: int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort); The lParam1 parameter is the 32-bit value associated with the first item being compared; and the lParam2 parameter is the value associated with the second item. These are the values that were specified in the lParam member of the items’ LV_ITEM structure when they were inserted into the list. The lParamSort parameter is the same value passed to the LVM_SORTITEMS message. The comparison function must return a negative value if the first item should precede the second, a positive value if the first item should follow the second, or zero if the two items are equivalent. See Also |