CreateProcessAsUser icon indicating copy to clipboard operation
CreateProcessAsUser copied to clipboard

Waitforexit and return exitcode

Open lordarokh opened this issue 6 years ago • 1 comments

Hi There,

I was wondering how is it possible to wait the process that has been started to exit and return the exit code, instead of process ID?

lordarokh avatar May 03 '19 09:05 lordarokh

That needs to be done outside of "CreateProcessAsUser" by using appropriate windows API. You can google for the particular APIs to be used, but I suspect it will be along the lines of WaitForSingleObject / GetExitCodeProcess. You will need to find how to interop these calls to .net and then you'll need experiment a bit with the exact sequence of calls that does what you want.

AndrewSav avatar May 04 '19 06:05 AndrewSav