uses
Windows, Forms,
Unit1 in 'Unit1.pas' {Form1};
{$R *.RES}
begin
Application.Initialize;
Application.Title:='我的测试程序';
CreateMutex(nil,False,'我的测试程序');
if (GetLastError()=ERROR_ALREADY_EXISTS) then
begin
Application.MessageBox(PChar('当前程序只能且只有一个实例运行'), '错误信息:', MB_ICONERROR);
exit;
end;
Application.CreateForm(TForm1, Form1);
Application.Run;
end.