1 2 procedure TForm1.FormCreate(Sender: TObject);
3 var4 iHandle:Hwnd;
5 begin6 Application.Title:='Temp'; //sets your application title to temp7 8 //looks for a pervious copy is running or not9 iHandle:=Findwindow(pchar('TApplication'),pchar('One Copy'));
10 if iHandle>0 thenbegin// if found then display message11 12 messagedlg('You can only have one copy of this application running on a
13 PC!'rror,[mbok],0);
14 application.Terminate; //terminates application15 16 exit;
17 end;
18 19 //sets back to the current application title;20 Application.Title:='One Copy';
21 end;
22