unit urunshellexecute;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  StdCtrls, ShellApi;

type
  TForm1 = class(TForm)
    Button1: TButton;
    eHINST: TEdit;
    Label1: TLabel;
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }

  end;

var
  Form1: TForm1;


implementation

{$R *.DFM}

procedure TForm1.Button1Click(Sender: TObject);
var
	parametros: String;
	res: hinst;
	exestr: string;
begin

	exestr:= SysUtils.GetCurrentDir+'\testshellexecute.exe'#0;
	 Parametros:= 'par1 "par2 con espacio" par3'#0;
	 res:= ShellExecute(self.Handle, 'open', @exestr[1], @Parametros[1], NIL, SW_SHOWNORMAL);
	 eHInst.text:= IntToStr( res );
end;

end.
