int WINAPI CustomSortProc(LPARAM Item1,LPARAM Item2,LPARAM ParamSort)
{
static bool b=true;
if(b)
{
b=false;
return -CompareText(((TListItem*)Item1)-> Caption,
((TListItem*)Item2)-> Caption);
}
else
{
b=true;
return CompareText(((TListItem*)Item1)-> Caption,
((TListItem*)Item2)-> Caption);
}
}
下面要触发排序,一般写在OnColumnClick事件中:
ListView1-> CustomSort(CustomSortProc,0);
标签:TListItem,LPARAM,排序,Item2,Item1,Caption,CompareText,listview From: https://blog.51cto.com/u_15487030/7521775