Disclaimer: I don't know Delphi. But, using Winapi, you would do as follows:
1. To create a process you would use CreateProcess() function:
2. Pay atention at the last parameter of CreateProcess: LPPROCESS_INFORMATION lpProcessInformation.
You can see details about the LPPROCESS_INFORMATION structure here: http://msdn.microsof...3(v=vs.85).aspx
The first member in the structure LPPROCESS_INFORMATION contains a handle to the process you have started.
So, this way you obtain a handle to the process you have started.
3. To wait for the launched process to finish, use the WaitForSimpleObject() function on the process handle, with second parameter set to INFINITE
It is described here:
4. After the process finished, you can get its exit code using the
5. After that, you should close the handle to the process by using the CloseHandle() function.
6. Launch the next process ...
It should be fairly easy to translate this to Delphi.
Edited by gonerogue, 17 May 2014 - 12:54 AM.