在你的主程序里写:
{$R *.RES}
var i: integer;
begin
if ret = ERROR_ALREADY_EXISTS then
halt
else
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end;
end.
{$R *.RES}
var i: integer;
begin
if ret = ERROR_ALREADY_EXISTS then
halt
else
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end;
end.
var i: integer;
begin
i := GetLastError;
if i= ERROR_ALREADY_EXISTS then
halt
else
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
end;
end.