By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,784 Members | 3,274 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,784 IT Pros & Developers. It's quick & easy.

Is it possible to embed a console window c#?

P: n/a
Curious how you could embed a console in a Windows form.. any ideas ?

Oct 17 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
On Oct 17, 9:50 am, ScottH <scott.ho...@gmail.comwrote:
Curious how you could embed a console in a Windows form.. any ideas ?
In the past I've done this using the AllocConsole API.

Oct 17 '07 #2

P: n/a
Yeah I got the console to show up that way. It comes up as a separate
window from my forms. I wanted to embed it in a form, any idea how to
do that?

On Oct 17, 11:07 am, Brian Gideon <briangid...@yahoo.comwrote:
On Oct 17, 9:50 am, ScottH <scott.ho...@gmail.comwrote:
Curious how you could embed a console in a Windows form.. any ideas ?

In the past I've done this using the AllocConsole API.

Oct 17 '07 #3

P: n/a
ScottH wrote:
Yeah I got the console to show up that way. It comes up as a separate
window from my forms. I wanted to embed it in a form, any idea how to
do that?
I am afraid that you will need to code the entire console then.

Arne
Oct 18 '07 #4

P: n/a
There is a way to pass values to the console window and return the response.
I used it once to get the return of a ping command. I'll post it if I find
the code. In the meanwhile have a look at this:
http://www.geekpedia.com/tutorial230...API-Calls.html -
I believe it's similar to what you've already done, but worth checking out.

"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:47***********************@news.sunsite.dk...
ScottH wrote:
>Yeah I got the console to show up that way. It comes up as a separate
window from my forms. I wanted to embed it in a form, any idea how to
do that?

I am afraid that you will need to code the entire console then.

Arne
Oct 18 '07 #5

P: n/a
I found it and posted it:
http://www.geekpedia.com/code42_Pass...nd-Prompt.html

Hope it helps.

"Andrew P." <an**********@geekpedia.comwrote in message
news:OK**************@TK2MSFTNGP04.phx.gbl...
There is a way to pass values to the console window and return the
response. I used it once to get the return of a ping command. I'll post it
if I find the code. In the meanwhile have a look at this:
http://www.geekpedia.com/tutorial230...API-Calls.html -
I believe it's similar to what you've already done, but worth checking
out.

"Arne Vajhøj" <ar**@vajhoej.dkwrote in message
news:47***********************@news.sunsite.dk...
>ScottH wrote:
>>Yeah I got the console to show up that way. It comes up as a separate
window from my forms. I wanted to embed it in a form, any idea how to
do that?

I am afraid that you will need to code the entire console then.

Arne
Oct 18 '07 #6

P: n/a
ScottH wrote:
Curious how you could embed a console in a Windows form.. any ideas ?
I made a tool that could either be pure command line or be windowed
depending on the arguments. If no arguments was supplied it was a
windowed interface. It also displayed a console. I just made a console
application and added windows to it like following.

[STAThread]
static void Main(string[] args)
{
if (args.Length == 0)
{
interactive = new Form1();
Application.Run(interactive);
}
else
DoCommandLine(args);
}

Hope this helps
Leon Lambert
Oct 18 '07 #7

P: n/a
thanks for all the response everyone :-)

On Oct 18, 6:49 am, Leon Lambert <lambe...@inil.comwrote:
ScottH wrote:
Curious how you could embed a console in a Windows form.. any ideas ?

I made a tool that could either be pure command line or be windowed
depending on the arguments. If no arguments was supplied it was a
windowed interface. It also displayed a console. I just made a console
application and added windows to it like following.

[STAThread]
static void Main(string[] args)
{
if (args.Length == 0)
{
interactive = new Form1();
Application.Run(interactive);
}
else
DoCommandLine(args);

}

Hope this helps
Leon Lambert

Oct 18 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.