unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, ShellAPI, StdCtrls;
type
TForm1 =
class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private-Deklarationen }
public
{ Public-Deklarationen }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure run;
begin
ShellExecute(Application.Handle,'
open',PChar(Paramstr(0)),
nil,
nil,SW_SHOWNORMAL);
end;
procedure TForm1.Button1Click(Sender: TObject);
var
ThreadID: DWORD;
ThreadHandle: THandle;
begin
ThreadHandle:=CreateThread(
nil, 0, TFNThreadStartRoutine(@Run),
nil, 0, ThreadID);
if ThreadHandle<>0
then CloseHandle(ThreadHandle);
end;
end.