/*
CustomSort example
The following code orders a list view in reverse alphabetical order on the click of a button. The callback function CustomSortProc calls the global CompareText function and negates its return value.
*/ 
int __stdcall CustomSortProc(long Item1, long Item2, long ParamSort)
{
  return -CompareText(((TListItem *)Item1)->Caption, 
                      ((TListItem *)Item2)->Caption);
}
void __fastcall TForm1::Button1Click(TObject *Sender)
{
  ListView1->CustomSort(CustomSortProc, 0);
} 
