از این کد استفاده کن :
کد:var Form1: TForm1; handle_temp:THandle; implementation {$R *.dfm} procedure TForm1.FormCreate(Sender: TObject); begin handle_temp:=CreateMutex(nil,TRUE,'project'); If handle_temp<>0 then If GetLastError=ERROR_ALREADY_EXISTS then begin Application.MessageBox('This program is runing','Error!',mb_ok); Application.Terminate; end; end;
علاقه مندي ها (Bookmarks)