var
MutexHandle:THandle;
begin
Application.Initialize;
MutexHandle :=windows.CreateMutex(nil,True,PChar(sApp_Name));
if MutexHandle <>0 then begin
if GetLastError = windows.ERROR_ALREADY_EXISTS then begin
MsgBox('程序己经运行过了。',1);
CloseHandle(MutexHandle);
Halt;
end;
end;
MutexHandle:THandle;
begin
Application.Initialize;
MutexHandle :=windows.CreateMutex(nil,True,PChar(sApp_Name));
if MutexHandle <>0 then begin
if GetLastError = windows.ERROR_ALREADY_EXISTS then begin
MsgBox('程序己经运行过了。',1);
CloseHandle(MutexHandle);
Halt;
end;
end;