Heat-treating apparatus with a cooling or quenching zone