472,362 Members | 2,248 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,362 software developers and data experts.

Is it possible to embed a console window c#?

Curious how you could embed a console in a Windows form.. any ideas ?

Oct 17 '07 #1
7 11952
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
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
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Jason Callas | last post by:
I am trying to figure out how to create a console window but cannot figure out how to do this. I know it can be done since the C# and VB console template projects do this but I see no code on how...
11
by: objectref | last post by:
Hi to all, i have a window app and i want to display some info in a console window. I figured out (after a very long search...) how am i supposed to do it and i try using the following code. ...
0
by: Russell Mangel | last post by:
Hi, I am using VS2003 Managed C++ and Windows Forms. I would like to bring up the Console Window, in a Windows Forms application. Console::WriteLine(i.ToString()); I can bring console window...
0
by: Mythran | last post by:
I can draw onto the console window where I want using a mixture of API calls and the System.Drawing namespace (.Net 1.1). I am trying to install hooks for the window to catch a resize or another...
2
by: stevie.greenslade | last post by:
'Lo all. I have a simple question I'd like help on. :] How, if at all, would one go about suppressing the console window that flashes up when you make at system() call in your C++ program? I'm...
7
by: Abelard | last post by:
How do I programmatically minimize the console window in a VB .NET console application?
10
by: Stephany Young | last post by:
When one uses the System.Diagnostics.Process.Start method to launch a common or garden Console application, one can set the WindowStyle property of the StartInfo object to ProcessWindowStyle.Hidden...
3
by: =?Utf-8?B?VGVycmFuY2U=?= | last post by:
Good Afternoon: I have two questions I was hoping someone can help me with. 1. I've created a app that creates a xml file; the project was constructed as a console window. I want to know is...
1
by: Pia Stevens | last post by:
A program opened at start a console window. How can I automatically minimized this window to Systray (not Taskbar)? Pia
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: AndyPSV | last post by:
HOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and on my computerHOW CAN I CREATE AN AI with an .executable file that would suck all files in the folder and...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Carina712 | last post by:
Setting background colors for Excel documents can help to improve the visual appeal of the document and make it easier to read and understand. Background colors can be used to highlight important...
1
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...
0
by: Johno34 | last post by:
I have this click event on my form. It speaks to a Datasheet Subform Private Sub Command260_Click() Dim r As DAO.Recordset Set r = Form_frmABCD.Form.RecordsetClone r.MoveFirst Do If...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.