dwmkerr / consolecontrol

ConsoleControl is a C# class library that lets you embed a console in a WinForms or WPF application.
MIT License
736 stars 171 forks source link

Unable to get ProcessId / or use WaitForExit() #49

Open sookels123 opened 4 years ago

sookels123 commented 4 years ago

I would like to start a new process directly after the first process completes, but I get an error "This BackgroundWorker is currently busy and cannot run multiple tasks concurrently"

I assume it is due to the first process still being active, but I have no means to check if it is active or wait for the process to complete.

Please assist :)

ayesc9000 commented 4 years ago

Is this issue directly related to the console? If so can you provide a little more info as to what you mean?

If you want to just check to see when the program running in the console window stops, then you can simply check the IsProcessRunning boolean in a loop of some sort. Preferably using a 250ms timer and just letting it run every time the tick event triggers.