Console Application Help
-
Hi everyone, I need help on two issue I faced during the making of my console program in .net(Any either C sharp or VB.NET). (1)1st is that the console program I made doesn't have the basic contex menu like the cmd has one and pops up when we right click on anywhere on the black area.I want the same or something similar to that one.How should I proceed? (2)2nd is when we launch a cmd program from cmd itself the program runs in the same window as of the cmd's own.Like if we run ping.exe then the cmd doesnt open a new window for it .Instead of that it simply runs the program in the same window.In my program I want to launch other console application(made by myself) but not in other window but the same of mine.How to do that? Any help in C# or VB will be helpful. Thanks in advance... Dan
-
Hi everyone, I need help on two issue I faced during the making of my console program in .net(Any either C sharp or VB.NET). (1)1st is that the console program I made doesn't have the basic contex menu like the cmd has one and pops up when we right click on anywhere on the black area.I want the same or something similar to that one.How should I proceed? (2)2nd is when we launch a cmd program from cmd itself the program runs in the same window as of the cmd's own.Like if we run ping.exe then the cmd doesnt open a new window for it .Instead of that it simply runs the program in the same window.In my program I want to launch other console application(made by myself) but not in other window but the same of mine.How to do that? Any help in C# or VB will be helpful. Thanks in advance... Dan
Dan Suthar wrote:
console program I made doesn't have the basic contex menu
Console application takes input from the command line and while running it may receive input from Console class and produce output. However, console application does not have graphical user interface elements (neither does cmd, the menu comes from the window where cmd runs)
Dan Suthar wrote:
In my program I want to launch other console application(made by myself) but not in other window but the same of mine
Didn't quite understand this. You can use Process class to start another process. If needed you can communicate with that process from your program even if the process doesn't have UI of any kind
The need to optimize rises from a bad design.My articles[^]
-
Dan Suthar wrote:
console program I made doesn't have the basic contex menu
Console application takes input from the command line and while running it may receive input from Console class and produce output. However, console application does not have graphical user interface elements (neither does cmd, the menu comes from the window where cmd runs)
Dan Suthar wrote:
In my program I want to launch other console application(made by myself) but not in other window but the same of mine
Didn't quite understand this. You can use Process class to start another process. If needed you can communicate with that process from your program even if the process doesn't have UI of any kind
The need to optimize rises from a bad design.My articles[^]
Let me explain my problem.I have made one exe of console programs namely a.exe.Now when I run the a.exe by double clicking on it ,it opens a usual console window and runs further in it.Now the window that just opened doesn't have the contex menu.You may have seen the one in the orignal cmd.exe.I am NOT refering to that when we right click on titlebar but the one when we click on the black area in cmd.
Mika Wendelius wrote:
neither does cmd, the menu comes from the window where cmd runs
So is there a way to bring that in mine a.exe program so that when I right click ,it popus up.The menu generally useful because it contains comands like paste and find etc. :confused: And,
Mika Wendelius wrote:
You can use Process class to start another process
So thanks for solving my second problem. :) Thanks, Dan
-
Let me explain my problem.I have made one exe of console programs namely a.exe.Now when I run the a.exe by double clicking on it ,it opens a usual console window and runs further in it.Now the window that just opened doesn't have the contex menu.You may have seen the one in the orignal cmd.exe.I am NOT refering to that when we right click on titlebar but the one when we click on the black area in cmd.
Mika Wendelius wrote:
neither does cmd, the menu comes from the window where cmd runs
So is there a way to bring that in mine a.exe program so that when I right click ,it popus up.The menu generally useful because it contains comands like paste and find etc. :confused: And,
Mika Wendelius wrote:
You can use Process class to start another process
So thanks for solving my second problem. :) Thanks, Dan
The only console windows that get the context menu you're talking about are the ones launched by CMD. This is a window that CMD wraps and adds the context menu and various other little tidbits. Any process that is launched by doubling-clicking on it is not run under CMD, so you don't get the context menu or anything else you would normally find. A console window has NOTHING to do with a "DOS" prompt. It's just a text window, kind of like a terminal emulator.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
The only console windows that get the context menu you're talking about are the ones launched by CMD. This is a window that CMD wraps and adds the context menu and various other little tidbits. Any process that is launched by doubling-clicking on it is not run under CMD, so you don't get the context menu or anything else you would normally find. A console window has NOTHING to do with a "DOS" prompt. It's just a text window, kind of like a terminal emulator.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Ok, Now I am getting the matter.So only the cmd itself has the context menu ! Thankyou very much for sharing your knowledge :)
-
The only console windows that get the context menu you're talking about are the ones launched by CMD. This is a window that CMD wraps and adds the context menu and various other little tidbits. Any process that is launched by doubling-clicking on it is not run under CMD, so you don't get the context menu or anything else you would normally find. A console window has NOTHING to do with a "DOS" prompt. It's just a text window, kind of like a terminal emulator.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008