while guarda < 1 do begin guarda2 :=1; ShellExecute(Handle, 'open', 'C:\Program Files\Rockstar Games\Grand Theft Auto V\PlayGTAV.exe', nil, nil, SW_SHOWNORMAL); while guarda2 <2 do begin if contadordabarra = 100 then begin guarda2 := 2 ; if VerificaExistenciaDoProcesso('GTA5.exe') then begin MessageDlg('Abriu!',mtInformation,[mbOk],0); guarda := 2 ; guarda2 := 2 ; end else KillTask('GTAVLauncher.exe'); ProgressBar1.Position := 0 ; end else MessageDlg(' contadordabarra!'+IntToStr(contadordabarra),mtInformation,[mbOk],0); end; MessageDlg('SAIU DO LOOP!',mtInformation,[mbOk],0); end;
end; o programa roda tudo certinho mas eu queria tirar os 2 ultimos else mas o programa trava nao queria que mostrase as messageDlg.