Console App

D

daveL

Is there a Way to open and close console window on
demand, nother words control the console from with in the application

DaveL
 
A

Arne Vajhøj

daveL said:
Is there a Way to open and close console window on
demand, nother words control the console from with in the application

There are some Win32 API functions that does that and you can
call them from C#.

I have some code somewhere if you are interested.

Arne
 
P

Pavel Minaev

I seem to recall there's a way to minimize, restore, and maximize the
console window... How do you get the window handle to the console?  From
there, it should be easy.

The WinAPI function for that is, perhaps surprisingly, called
"GetConsoleWindow".

Functions to create and close a console in the process are
"AllocConsole" and "CloseConsole", respectively.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top