在你的project.dpr中这样做:
CreateMutex(nil, True, 'DECISRVR');
if GetLastError = ERROR_ALREADY_EXISTS then
begin
MessageBox(0, PChar(SAlreadyRunning), SApplicationName, MB_ICONERROR);
Halt;
end;
Application.Initialize;
Application.CreateForm(TfrmMain, frmMain);
Application.CreateForm(TSocketForm, SocketForm);
try
SocketForm.Initialize(False);
except
//Socket server already runing
SocketForm.Free;
SocketForm := nil;
end;
Application.Run;