10

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!

Rui Marques
  • 8,567
  • 3
  • 60
  • 91
  • Have you tried to change your project settings to "console application"? – L.B Sep 09 '12 at 15:25
  • I'm making a GUI application because the server is already a console application. I'm writing a GUI for the server. –  Sep 09 '12 at 15:29
  • You wrote *"I also want to add a console inside the Winforms application"*, this is why i commented. This way you have a winform app together with a console. – L.B Sep 09 '12 at 15:34
  • The console is not written in C#, so I can't just- OOH WAIT but whatever I just found a control and it works good, so I'm just gonna use it. Thank you! –  Sep 09 '12 at 15:39
  • 2
    Possible duplicate of [Embedding a DOS console in a windows form](http://stackoverflow.com/questions/355724/embedding-a-dos-console-in-a-windows-form) – Cobus Kruger Mar 07 '17 at 10:46

1 Answers1

1

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.

Yennefer
  • 5,704
  • 7
  • 31
  • 44