uses CommCtrl;
procedure TForm1.ListView1MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
var
item: TListItem;
lvhti: LV_HITTESTINFO;
begin
item := ListView1.GetItemAt(X, Y);
if (item <> nil) then
Caption := 'Mouse at: ' + item.Caption
else
begin
lvhti.pt.X := X;
lvhti.pt.Y := Y;
ListView_SubItemHitTest(ListView1.Handle, @lvhti);
if Assigned(ListView1.Items[lvhti.iItem])
and (ListView1.Items[lvhti.iItem].SubItems.Count >= lvhti.iSubItem) then
Caption := 'Mouse at:' + ListView1.Items[lvhti.iItem].SubItems[lvhti.iSubItem - 1];
end;
end;