VCL Delphi

procedure TForm1.Button1Click(Sender: TObject);
var
search: string;
begin
search := 'swissdelphicenter';
if SendMessage(ListBox1.Handle, lb_selectstring, - 1, Longint(PChar(search))) <> LB_ERR then
ShowMessage('Item selected: ' + IntToStr(ListBox1.ItemIndex));
end;