01BTC10
01BTC10

Reputation: 536

How to wait for a process to finish C++

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++ ?

Upvotes: 21

Views: 34638

Answers (1)

Nikola Smiljanić
Nikola Smiljanić

Reputation: 26863

You just call WaitForSingleObject on the handle CreateProcess returns.

Upvotes: 37

Related Questions