I’ve written a program in C++. It’s just using the console to have it as portable as possible. Unfortunately, many Windows-Users seem not to understand how to use the program (Linux Users are just fine with it 🙂 ). So I’d like to write a GUI for that program. As this needs to run on Windows only, I’d like to write it in C#.
But I want to maintain the GUI apart from the original program. So basically, I need a way to include a compiled *.exe into another program. Is there a way to catch the console output from another program and send inputs to it? Also, can the console of the original program be hidden?
Similar Questions
There are a number of ways that you might go about doing this. The System.Diagnostics.Process class has methods that allow you to get access to the Input and Output of the application, you could automate it from there.
Basically you can use the StandardInput and StandardOutput methods to get the output and then interact with the inputs to control the application. The posting in the “Similar Questions” addition to your question shows the first part of that, the StandardOutput portion.