B
Brad
I want to start another process in code, wait for it to finish, then
continue. No problem, I do the following:
prcs := System.Diagnostics.Process.Start('E:\blah.txt');
if assigned(prcs) then begin
prcs.WaitForExit;
prcs.Close;
end;
This works fine if my default application for the given file type is not
already running. If it is running and it handles multiple open
documents, it will just open a new document in the same process in which
case prcs is not assigned (null) because it didn't actually start the
process. Then of course, I can't wait for the process to exit.
Is there any way to get a pointer/handle to the process in these cases?
continue. No problem, I do the following:
prcs := System.Diagnostics.Process.Start('E:\blah.txt');
if assigned(prcs) then begin
prcs.WaitForExit;
prcs.Close;
end;
This works fine if my default application for the given file type is not
already running. If it is running and it handles multiple open
documents, it will just open a new document in the same process in which
case prcs is not assigned (null) because it didn't actually start the
process. Then of course, I can't wait for the process to exit.
Is there any way to get a pointer/handle to the process in these cases?