I’m talking about the use of HDF_SORTDOWN = $0200 and HDF_SORTUP = $0400 in the procedure TsCustomListView.ColumnSkinPaint.
But I just realized that this feature is not available through de VCL. It must be called directly using the win32 api.
Sample code I found on the Internet
procedure TForm1.sListView1ColumnClick(Sender: TObject; Column: TListColumn);
const
HDF_SORTDOWN = $0200;
HDF_SORTUP = $0400;
var
Header: HWND;
Item: THDItem;
begin
Header := ListView_GetHeader(TWinControl(Sender).Handle);
ZeroMemory(@Item, SizeOf(Item));
Item.Mask := HDI_FORMAT;
Header_GetItem(Header, Column.Index, Item);
Item.fmt := Item.fmt and not (HDF_SORTUP or HDF_SORTDOWN);//remove both flags
Item.fmt := Item.fmt or HDF_SORTUP;//include the sort ascending flag
Header_SetItem(Header, Column.Index, Item);
end;
Stephane Senecal
CIS Group
Delphi programmer since 2001