本文整理自网络,侵删。
让程序只运行1次
procedure TForm1.FormCreate(Sender: TObject);
begin
CreateMutex(nil,False,'NetSend');
if GetLastError=ERROR_ALREADY_EXISTS then
begin
Halt(0);
end;
end;
end.
相关阅读 >>
Delphi winapi: getmodulefilename、getmodulehandle
Delphi 的 tstringbuilder 可以完美实现jave ,c#的tstringbuilder功能
更多相关阅读请进入《Delphi》频道 >>