procedure TForm1.FormCreate(Sender: TObject); begin CreateMutex(nil,False,'Form1'); if GetLastError=ERROR_ALREADY_EXISTS then begin ShowMessage('程序已运行,请勿执行多个程序实例'); Halt(0); end; end;
procedure TForm1.FormCreate(Sender: TObject); begin CreateMutex(nil,False,'Form1'); if GetLastError=ERROR_ALREADY_EXISTS then begin ShowMessage('程序已运行,请勿执行多个程序实例'); Halt(0); end; end;