Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. .NET (Core and Framework)
  4. Console Application Help

Console Application Help

Scheduled Pinned Locked Moved .NET (Core and Framework)
csharphelptutorialquestion
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dan Suthar
    wrote on last edited by
    #1

    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

    W 1 Reply Last reply
    0
    • D Dan Suthar

      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

      W Offline
      W Offline
      Wendelius
      wrote on last edited by
      #2

      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[^]

      D 1 Reply Last reply
      0
      • W Wendelius

        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[^]

        D Offline
        D Offline
        Dan Suthar
        wrote on last edited by
        #3

        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

        D 1 Reply Last reply
        0
        • D Dan Suthar

          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

          D Offline
          D Offline
          Dave Kreskowiak
          wrote on last edited by
          #4

          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

          D W 2 Replies Last reply
          0
          • D Dave Kreskowiak

            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

            D Offline
            D Offline
            Dan Suthar
            wrote on last edited by
            #5

            Ok, Now I am getting the matter.So only the cmd itself has the context menu ! Thankyou very much for sharing your knowledge :)

            1 Reply Last reply
            0
            • D Dave Kreskowiak

              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

              W Offline
              W Offline
              Wendelius
              wrote on last edited by
              #6

              Thanks for replying to this. Didn't have the opportunity earlier. This was exactly the thing what I was trying to explain.

              The need to optimize rises from a bad design.My articles[^]

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups