Enjoyed the Process API in .NET
The Process API in the .NET Framework is really well designed. I'm talking about 1.x. Basically, it integrates in a single class--Process--the functionality of the Win32 process API, the shell, and also the notorious ToolHelp API. In addition, it has a few gems like the Responding property and the WaitForExit method. The former sends a timeout message to the main window of the process. If it doesn't get a reply within 5 seconds, it concludes that the process is gone and not responding. The WaitForExit method simply stops the current thread until the spawned process terminates. The code you need is as simple as
Dim p As New Process
p = Process.Start("notepad.exe")
p.WaitForExit()
Another little known but useful feature is associated with the SynchronizingObject property. The Process class has an event named Exited that fires when a process terminates. If you handle this event, chances are that you then need to update the user interface of a Windows Forms application.
Windows Forms applications are STA apps and nothing guarantees that the thread in charge of the Exited event is the same that created the Windows Forms control you need to refresh. Make the SynchronizingObject property point to the control you will work with, and the Process class will automatically marshal the call from thread to thread with the certainty--for you--that no delay, no anomalies, no exceptions occur.
Capturing the output of a console program is much easier than before.
I've just sent an article on this topic to Code Magazine. It should be published in the next few months.