main.dpr

来自「经典魔兽程序经典魔兽程序经典魔兽程序经典魔兽程序」· DPR 代码 · 共 27 行

DPR
27 行
字号
program Main;

uses
  Forms,
  Windows,
  SysUtils,
  UnitMain in 'UnitMain.pas' {Form1};

{$R *.res}
var
  myMutex:HWND;
  exefilename:String;
begin
  exefilename:=ParamStr(1);
  if exefilename<>'' then begin
    if fileexists(exefilename) then
      winexec(Pchar(exefilename),SW_SHOWNORMAL);
  end;
  myMutex:=CreateMutex(nil,false,'MSLV1108');
  if WaitForSingleObject(myMutex,0)<>wait_TimeOut then//程序没有被运行过
  begin
    Application.Initialize;
    Application.CreateForm(TForm1, Form1);
    Application.Run;
  end;
end.

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?