S
shijiesun2
Unregistered / Unconfirmed
GUEST, unregistred user!
var
HMutex:THandle;
Initialization
MutexHandle:=CreateMutex(Nil,False,'互斥软件名');
if GetLastError=Error_Already_Exists then
begin
Application.MessageBox('该程序已经打开.','提示',64);
ReleaseMutex(MutexHandle);
CloseHandle(MutexHandle);
Application.Terminate;
end;
HMutex:THandle;
Initialization
MutexHandle:=CreateMutex(Nil,False,'互斥软件名');
if GetLastError=Error_Already_Exists then
begin
Application.MessageBox('该程序已经打开.','提示',64);
ReleaseMutex(MutexHandle);
CloseHandle(MutexHandle);
Application.Terminate;
end;