handle:=openmutex(mutex_all_access,false,'ddddd');
if handle=0 then
begin
handle:=createmutex(nil,false,'ddddd');
if handle=0 then
begin
showmess(3,'创建程序同步出错!!!','注意');
exit;
end;
end else
begin
// showmess(3,'该程序已运行!!!','注意');
exit;
end;
if handle=0 then
begin
handle:=createmutex(nil,false,'ddddd');
if handle=0 then
begin
showmess(3,'创建程序同步出错!!!','注意');
exit;
end;
end else
begin
// showmess(3,'该程序已运行!!!','注意');
exit;
end;
脱离ide 就行