I've created an add-in for a program that starts up a console using the following code block below however I don't know how to close the console window without closing the entire program. I've found this example but when I try Environment.Exit(0)
it closes my entire program.
I've been on this for a couple of days however I'm not having any luck with this. Long story short, I am creating the console to pipe information between it and another process. Once it receives the information, I'd like it to close and resume to the parent process. I am sure this is an easy thing to but I'm not finding the solution on my own.
Could someone point me in the right direction? Thank you in advance.
private void Form1_Load(object sender, EventArgs e)
{
AllocConsole();
}
[DllImport("kernel32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool AllocConsole();