A macro is called inside , but I donβt see any mention of how to stop the sorting process in the link (even through the callback function), so I am afraid that this is impossible (at least normal).TListView.AlphaSort ListView_SortItems
Sertac, , OnCompare:
var
YouWantToAbortSort: Boolean;
procedure TForm1.Button1Click(Sender: TObject);
begin
YouWantToAbortSort := False;
ListView1.AlphaSort;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
YouWantToAbortSort := True;
end;
procedure TForm1.ListView1Compare(Sender: TObject; Item1, Item2: TListItem;
Data: Integer; var Compare: Integer);
begin
if YouWantToAbortSort then
Abort;
// some sorting function here ...
Application.ProcessMessages;
end;