18

I am creating a process with that code:

CreateProcess(NULL, "process.exe", NULL, NULL, TRUE, 0, NULL, NULL, %ini_processo, %processo_info);

I need my code to wait for my process to finish before resuming. What is the method with C++ ?

01BTC10
  • 476
  • 3
  • 8
  • 19

1 Answers1

34

You just call WaitForSingleObject on the handle CreateProcess returns.

Rotem
  • 20,778
  • 6
  • 60
  • 108
Nikola Smiljanić
  • 26,469
  • 6
  • 46
  • 59