I have a function which starts a process, waits for exit and than returns the exitcode:
function int login(string pathtofile)
{
//...
Process process = new Process();
process.StartInfo.FileName = pathtofile;
process.Start();
process.WaitForExit();
return process.ExitCode;
}
This is working well. But because its waiting for Exit, it blocks the Window Form (I have a Marquee Progress Bar which is conitnues moving and now obivously stops). I have no idea how to return the exit code async and I couldn't find any possible solution that I understood.