I am creating a process with that code:
CreateProcess(NULL, \"process.exe\", NULL, NULL, TRUE, 0, NULL, NULL, %ini_processo, %processo_info);
You just call WaitForSingleObject on the handle CreateProcess returns.