var
MutexHandle: Integer;
begin
if OpenMutex(MUTEX_ALL_ACCESS, FALSE, 'RunOnceMutex') <> 0 then
begin
ShowMessage('This application is already open!');
Exit;
end;
MutexHandle := CreateMutex(nil, TRUE, 'RunOnceMutex');
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
ReleaseMutex(MutexHandle);
end;