1

How do I know if the time limit has expired or the process was terminated by the user?

Process p = Process.Start(this.EmergencyApp, npLang);
p.WaitForExit(this.Timeout);
peter70
  • 1,053
  • 16
  • 31

1 Answers1

1

WaitForExit() returns a boolean:

Return Value
true if the associated process has exited; otherwise, false.

SLaks
  • 868,454
  • 176
  • 1,908
  • 1,964
  • Oh, I saw only the call without parameters. This is void. That is why I have seen over the return type bool. Thank you!!! – peter70 Mar 22 '13 at 11:59
  • You must observe something here! If the process is already running, WaitForExit will complete immediately with a true – peter70 Mar 22 '13 at 13:14
  • And another thing! Before calling the WaitForExit, WaitForInputIdle should be called. http://support.Microsoft.com/kb/305369/en-us – peter70 Mar 22 '13 at 13:17