procedure TMyListView.SetColumnSortOrder(Column: TListcolumn);
var
hdr: HWND;
hdritem: THDItem;
begin
hdr := Listview_GetHeader(
handle);
FillChar(hdritem, sizeof(hdritem), 0);
hdritem.Mask := HDI_FORMAT;
Header_GetItem(hdr, column.
index, hdritem);
hdritem.Mask := HDI_FORMAT
or HDI_BITMAP;
if FSortDirection=sdAscending
then
hdritem.hbm := FUpArrow.Handle
else
hdritem.hbm := FDownArrow.Handle;
if fsortarrowwhere=saLeft
then
hdritem.fmt := hdritem.fmt
or HDF_BITMAP
else
hdritem.fmt := hdritem.fmt
or HDF_BITMAP_ON_RIGHT
or HDF_BITMAP;
Header_SetItem(hdr, column.
index, hdritem);
end;