unit SSHClientStartThread;

interface

uses
  Classes,shellapi,windows;

type
  SSHClientStart = class(TThread)
  private
    { Private declarations }
  protected
    procedure Execute; 
  end;

implementation
uses unit1;

{ Important: Methods and properties of objects in visual components can only be
  used in a method called using Synchronize, for example,

      Synchronize(UpdateCaption);

  and UpdateCaption could look like,

    procedure SSHClientStart.UpdateCaption;
    begin
      Form1.Caption := 'Updated in a thread';
    end; }

{ SSHClientStart }

procedure SSHClientStart.Execute;
begin
  { Place thread code here }

  ShellExecute(main.Handle, 'open', pchar(unit1.Programma), pchar(unit1.Parametri), pchar(unit1.Directory), SW_SHOW);
end;

end.
