这样可以:
program Project1;
uses
Forms,
windows,
.....;
Resourcestring
FMutex = 'Mutex_ONLY_ONE';
{$R *.RES}
var
hMutex: HWND;
iRet: integer;
begin
Application.Initialize;
hMutex := CreateMutex(nil,False,PChar(FMutex));//建立
iRet := GetLastError;
if iRet <>ERROR_ALREADY_EXISTS then //成功建立,说明是第一次
begin
winexec(ParamStr(0),sw_show); //再次运行自己
Application.Terminate; //停止自己
end
else //否则是第二次以上
begin
Application.CreateForm(TForm1, Form1);
Application.Run;
ReleaseMutex(hMutex); //释放
end;
end.