简体   繁体   中英

How to embed a Console application inside a Winforms application

I'm developing an application which acts as a GUI for Minecraft Server (runs as a console Java application).

I have finished it and I also want to add a console inside the Winforms application because I want to give users more control over the program. But using streams (Process.StandardOutput) I can't simulate a console as it sometimes changes the cursor position, clears the console, etc...

So, I want to embed the process into the application somehow. The first solution I tried was removing the borders and positioning it accordingly to the form's position but unfortunately I couldn't do it.

Any working code snippets would be greatly appreciated!

You cannot target both subsystem gui and console in the same module ( msdn ).

Instead, you could add a separate console application that uses SOAP to communicate with your application. Take a look at WCF to achieve this task.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM