Hola Angel.Matilla.
Lo podes usar para enviar el sentido del órden, tomando el ejemplo anterior quedaría:
Código:
int __stdcall CustomSortFn(long Item1, long Item2, long ParamSort)
{
return CompareText(((TListItem *)Item1)->Caption,
((TListItem *)Item2)->Caption) * ParamSort;
}
void __fastcall TForm1::ListView1ColumnClick(TObject *Sender,
TListColumn *Column)
{
static int order = 1;
order = (order == 1 ? -1 : 1) ;
ListView1->CustomSort(CustomSortFn, order);
}
Saludos