procedure TForm1.FileListBox1MouseDown(Sender: TObject;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var
P : TPoint;
SI: Integer;
begin
SI := SelectedItemIndex(FileListBox1);
if (ssRight in Shift) and (SI <> -1) then
begin
P.X:= FileListBox1.Width - FileListBox1.Left + 40;
P.Y:= FileListBox1.Top + SI * FileListBox1.ItemHeight - 50;
P := ClientToScreen(P);
PopupMenu1.Popup(P.X, P.Y);
end;
end;