DWORD status; ... GetExitCodeProcess(ProcessInformation.hProcess, &status); ret = (int)status;