Author: Tomas Rutkauskas Is it possible to activate the click or double-click event for the subitems of a listview item? If yes, how can I do it? Answer: 1 uses 2 CommCtrl; 3 4 {$R *.dfm} 5 6 procedure TForm1.ListView1Click(Sender: TObject); 7 var 8 pt: TPoint; 9 item: TLIstItem; 10 hittestinfo: TLVHitTestInfo; 11 begin 12 pt := listview1.ScreenToClient(mouse.cursorpos); 13 item := listview1.GetItemAt(pt.x, pt.y); 14 if assigned(item) then 15 memo1.Lines.add('Hit on item ' + item.Caption) 16 else 17 begin 18 FillChar(hittestinfo, sizeof(hittestinfo), 0); 19 hittestinfo.pt := pt; 20 if - 1 <> listview1.perform(LVM_SUBITEMHITTEST, 0, lparam(@hittestinfo)) then 21 begin 22 memo1.lines.add(format('Item: %d (%s), subitem: %d (%s)', [hittestinfo.iItem, 23 listview1.items[hittestinfo.iItem].caption, hittestinfo.iSubItem, 24 listview1.items[hittestinfo.iItem].Subitems[hittestinfo.iSubItem - 1]])); 25 26 end 27 else 28 memo1.lines.add('Not on item or subitem'); 29 end; 30 end;