C
cntiny
Unregistered / Unconfirmed
GUEST, unregistred user!
我用procedure TForm1.FormCreate(Sender: TObject);
begin
SetWindowLong (Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
RegisterServiceProcess(0,RSP_SIMPLE_SERVICE);
////
if OpenMutex(MUTEX_ALL_ACCESS,True,'Projectabc')>0 then
begin
MessageBox(0,'程序已经在运行','错误',MB_OK);
end
else
begin
CreateMutex(nil,True,'Projectabc');
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
CloseHandle(OpenMutex(MUTEX_ALL_ACCESS,True,'Projectabc'));
end;
/////
end;
能检测到程序一运行了,但程序弹出一个窗口后还是运行了,怎么不实现推出呀!!
begin
SetWindowLong (Application.Handle, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
RegisterServiceProcess(0,RSP_SIMPLE_SERVICE);
////
if OpenMutex(MUTEX_ALL_ACCESS,True,'Projectabc')>0 then
begin
MessageBox(0,'程序已经在运行','错误',MB_OK);
end
else
begin
CreateMutex(nil,True,'Projectabc');
Application.Initialize;
Application.CreateForm(TForm1, Form1);
Application.Run;
CloseHandle(OpenMutex(MUTEX_ALL_ACCESS,True,'Projectabc'));
end;
/////
end;
能检测到程序一运行了,但程序弹出一个窗口后还是运行了,怎么不实现推出呀!!