Shut off DOS screen automatically to Windows

This is a discussion on Shut off DOS screen automatically to Windows within the A Brief History of Cprogramming.com forums, part of the Community Boards category; There are two screens(two applications). one is DOS screen, the other is Windows. Dos screen get generated when the some ...

  1. #1
    Unregistered
    Guest

    Shut off DOS screen automatically to Windows

    There are two screens(two applications). one is DOS screen, the other is Windows. Dos screen get generated when the some function get called in Windows screen. Then the computer will continue the function in the DOS screen. When the DOS application get finished, it needs to switch to Windows screen again. I could press to Ctrl + C to go back to Windows but I want the DOS screen could automatically shut off when the application in DOS screen get finished.


    So is anyone knows how to code to switch DOS screen to Windows screen with press anykey?

    Thanks

  2. #2
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    Let me get this straight. You want the DOS terminal screen to go away when your program finishes, right?

    That's simple. Just make the call to clrscr() the last statement before your return.

    Ex.:

    Code:
    int main()
    {
       ...
       clrscr();
       return 0;
    }

  3. #3
    Banned frenchfry164's Avatar
    Join Date
    Oct 2001
    Posts
    1,552
    Or does he want the dos window to automatically close? Then use this:

    Code:
    int main()
    {
    ...
    system("EXIT");
    return 0;
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. FlashWindowEx not declared?
    By Aidman in forum Windows Programming
    Replies: 3
    Last Post: 05-17-2003, 02:58 AM
  2. from dos to windows
    By danielpaval in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 01-05-2003, 03:27 PM
  3. DOS experience 0 windows experience help
    By shrin2000 in forum Windows Programming
    Replies: 5
    Last Post: 07-15-2002, 02:22 AM
  4. Virtual screen, character based DOS interface
    By arakvaag in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 04-05-2002, 01:41 AM
  5. shutting down windows
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 01-02-2002, 11:28 AM

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