Hello, everyone knows the CreateProcess function, we run something like this.

if(CreateProcess(...)) { WaitForSingleObject(...); } CloseHandle(...); 

Nowhere did you find how to start the process so that the calling process does not hang, help. I tried a bunch of flags inside the createprocess (), including changing the environment variables - and failed.

  • 2
    Have you tried WaitForSingleObject to clean? - Vladimir Martyanov
  • honestly no - xperious
  • The function name says ... Reading MSDN when problems arise with WinAPI is the first thing to do. - Vladimir Martyanov
  • Well, yes, the waitforsingleobject has been removed and the calling process no longer hangs ... now another question is how to kill this process in some time now? create a separate thread, wait for this time in it and terminateprocess from it? - xperious
  • And you try - Vladimir Martyanov

1 answer 1

"Hangs", or rather waits, not CreateProcess, but WaitForSingleObject. Specifically clarified: there is nothing about waiting for CreateProcess in MSDN.