D
Douglas Harber
Is there any way to do an asynchronous wait for a process to exit? My
application needs to monitor when processes it launched have completed and
take further action. However, the app can launch processes essentially
randomly (with respect to any other launched processes and/or their
completion). The current implementation has to create a thread per process
simply to wait for that process to exit and fire an event back into the main
thread. It would be a whole lot simpler if there was a BeginWaitForExit()
method on Process to allow my app to be notified asynchronously as each
process terminated.
Is there any way to emulate that kind of functionality? So far, I'm missing
it.
In fact, it's not clear to me that you can asynchronously wait on any
signalable Win32 object in the elegant generalized fashion of Win32.
Am I overlooking some functionality that's available in .NET?
BTW, it's fine if it'a .NET 2.0 only thing.
Thanks,
Doug Harber
application needs to monitor when processes it launched have completed and
take further action. However, the app can launch processes essentially
randomly (with respect to any other launched processes and/or their
completion). The current implementation has to create a thread per process
simply to wait for that process to exit and fire an event back into the main
thread. It would be a whole lot simpler if there was a BeginWaitForExit()
method on Process to allow my app to be notified asynchronously as each
process terminated.
Is there any way to emulate that kind of functionality? So far, I'm missing
it.
In fact, it's not clear to me that you can asynchronously wait on any
signalable Win32 object in the elegant generalized fashion of Win32.
Am I overlooking some functionality that's available in .NET?
BTW, it's fine if it'a .NET 2.0 only thing.
Thanks,
Doug Harber