It is not impossible but why would you like to do so? Anyway to answer your question, I created a simple Windows App using C#, I just copied the code below for you,
using System.Windows.Forms;
namespace GUI_Test
{
public partial class Form1 : Form
{
public Form1()
{
AllocConsole();
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
}
private void button1_Click(object sender, EventArgs e)
{
System.Console.WriteLine("Hello World");
}
[System.Runtime.InteropServices.DllImport("kernel32.dll")]
private static extern bool AllocConsole();
}
}
Please ignore the naming convention, it is just a test app.
Hope it helps :)