真的吗?我没有2000系统,请好心人帮忙测试一下!!
我的程序其实很简单,在主Form中:(我想禁止运行多个拷贝)
procedure TForm1.FormShow(Sender: TObject);
var
hMutex,waiting:Cardinal;
begin
hMutex:=CreateMutex(Nil,False,'TheMutex');
waiting:=WaitForSingleObject(hMutex,0);
if waiting=wait_timeout then
begin
releaseMutex(hMutex);
showmessage('This Application is already runing!');
close;
end;
end;