473,394 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 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 12059
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
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.