What do you expect the tprocess suspend/resume actually does? IOW what do you want to achieve?
(and no, suspend/resume is probably not it)
Agreed. Unless you are writing your own debugger, suspending/resuming is a very bad idea, especially if it is an app you don't have control over. Do you have the source code for the app? If so, creating an inter-process communication channel between your main app and the spawned app would be much safer. Let the main app notify the spawned app when to "suspend" its processing of data without actually suspending the process itself, and then notify again when you want it to "resume" processing.
The reason why I want to use suspend/resume is this:
-using TProcess.Execute / TProcess.Terminate has the effect that with Execute the spawned app needs some few milliseconds to initialize (actually it is a VoIP streaming app, I don't have control over it) which means that there is a short time gap before the VoIP stream starts.
- using Suspend / Resume, the VoIP stream starts immediately.
- question: what exactly is Suspend / Resume doing? I suppose it halts the execution at any point of the code and then continues at the same position in the code, like in an IDE debugging session with breakpoints? Am I right?
- My solution should be either to use Execute / Terminate repeatedly and to accept the time gap (which actually is not a big deal)
- Or to keep track of the Suspend / Resume state with a variable in the main app. But as you mentionned above, this might have unknown side effects for the spawned app.