Given you dont show us any code its a bit of a guess for us as to how to help you. In short, if you're using
PROCESS_INFORMATION processInformation = {0};
in your call to CreateProcess, you can then
WaitForSingleObject( processInformation.hProcess, INFINITE );
DWORD exitCode;
BOOL result = GetExitCodeProcess(processInformation.hProcess, &exitCode);