本文整理自网络,侵删。
procedure TForm1.FormCreate(Sender: TObject); var errno:integer; hmutex:hwnd; begin hmutex:=createmutex(nil,false,pchar(application.Title)); errno:=getlasterror; if errno=error_already_exists then begin ShowMessage(‘程序已经在运行了’); Application.Terminate; end; end;
相关阅读 >>
Delphi android windows ios通用获取程序版本
Delphi xe android platform uses-permission[1] 权限列表
更多相关阅读请进入《Delphi》频道 >>