Group: Forum Members
Posts: 2K,
Visits: 6.6K
|
Gerard,
I've created a couple of sample apps to demonstrate a couple of ways to do this.
The first way, via the UnattendedModeSample, shows how to have your exe be opened either with a normal UI or to just automatically run a process. The process opens a status form and updates it no matter how it is called.
The second method is more robust, decoupling the process entirely from any UI. The other three projects demonstrate this. The SampleProcess project has a class that runs a process. When the process runs, it raises an event ProcessStepCompleted that consumers can handle to display messages from the process. The ProcessWinformUI will display the process messages in a textbox on the form, while the ProcessConsoleUI displays the progress to the command window.
The second method allows for completely unattended running, use in batch files etc. because the process runs completely with without user interface.
|