Like Tree3Likes
  • 1 Post By AndrewHunter
  • 2 Post By adeyblue

How to make program that opens and closes the command prompt.

This is a discussion on How to make program that opens and closes the command prompt. within the C++ Programming forums, part of the General Programming Boards category; Hello, I hope you are having a good day and thank you for taking the time to help me. How ...

  1. #1
    Registered User
    Join Date
    Jul 2011
    Posts
    8

    How to make program that opens and closes the command prompt.

    Hello,

    I hope you are having a good day and thank you for taking the time to help me.

    How would I go about creating a program that opens and closes the command prompt. I just realized that I can't create a program that runs in the background, independent of the command prompt, while creating a project under a "CLR Console Application" in Microsoft Visual Studio.

    What application would I need to use? Would I just start an "empty Project"? Are there some examples that show code which opens command prompts and then closes them while the program is still running?

    Is there a way to make the program I have right now which opens a command prompt and awaits a number followed by ENTER a subroutine? And after the subroutine, the program closes the command prompt?

    Also, what could solve my problem is having a way to keep the console ontop of the Z order because once I type in a number, the computer will open up an image. Is there anyway to keep the console "ontop" or at the highest Z order so that I don't have to click on the console to type into it.

    THANK YOU!!!!

    Computer specifications:

    64-bit Dell running Windows 7 OS.

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    You said earlier I think that you are getting the info from another device. Why not just listen to the device, instead of opening up a window, somehow funneling the device input into the terminal, and then resetting the focus to the terminal? Or if somehow the device is simulating keyboard events, just use the windows api for keyboard events?

  3. #3
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,866
    There is no need to start a new thread just because you didn't get the answer yet from your other thread with the same problem
    +K.Flynn+ likes this.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  4. #4
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    612
    I don't know, he created a whole new account to post that other thread. Who knows what other dastardly plans the webmaster has enacted now he's made the board IE only.

  5. #5
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,866
    Quote Originally Posted by adeyblue View Post
    I don't know, he created a whole new account to post that other thread. Who knows what other dastardly plans the webmaster has enacted now he's made the board IE only.
    Hahaha.....Sweet, we haven't had a good mod conspiracy thread on here in quite sometime.

    *whispers* I heard all the mods and the webmaster got together and sacrificed a noob to please the computer Gods and I also heard that*looks around, leans in*sharris is next.*runs away*
    Last edited by AndrewHunter; 07-13-2011 at 09:29 PM.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 2
    Last Post: 11-07-2010, 08:54 PM
  2. Program closes as soon as it opens?
    By Kamarill in forum C++ Programming
    Replies: 10
    Last Post: 09-24-2008, 09:36 PM
  3. Weird command prompt error, program not working..
    By Shamino in forum C++ Programming
    Replies: 18
    Last Post: 10-30-2007, 12:32 PM
  4. Replies: 2
    Last Post: 12-22-2006, 08:45 PM
  5. How do you run a program from the command prompt?
    By 7stud in forum C++ Programming
    Replies: 5
    Last Post: 08-20-2003, 09:46 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21