Hello, I have run the new process using ShellExecuteEx. The process is run properly. But if I try to check the hasExited property the process threw this exception. Why is it and what to do to check if the process alive?
ShellExecuteEx(ref info);
clientProcessId = NativeMethods.GetProcessId(info.hProcess);
Process clientProcess = Process.GetProcessById((int)clientProcessId);
if (clientProcess.hasExited) //<---- exception but the process is alive exactly! I can see its window
{
//run new one
}
Thanks