Thread: from dos to windows

  1. #1
    Registered User
    Join Date
    Dec 2002
    Posts
    14

    from dos to windows

    When I finish running a dos programme in windows, the window doesn't close automaticly. I have to click the "X".

    What can I do?
    Is there something I can add to the source code to solve the problem?

    Thanks.

  2. #2
    Registered User
    Join Date
    Dec 2002
    Posts
    14
    Thanks, it worked!

  3. #3
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    Originally posted by Salem
    Odd - most people have the other problem of the window going away too quickly so they can't see the results.

    Click on the top-left icon of the window (in the title bar), and choose properties. There should be a tick-box for "close on exit", which you should tick.

    If you do this to the shortcut which created the window as well, then all further windows you launch from that shortcut will have it.
    That requires a packaged program information file though salem. Even though you're going to transition a program from DOS to Windows I remember that I was able to get a program to close automatically without additional configuration files.

    I don't exactly remember how though.

    I believe it was something to do with clearing the screen before returning the final result(return 0) to the operating system.

    Yeah, I think that was it.

    With a batch file, I know that works for certain.
    Before, I would get the OP's results and it wouldn't close automatically, so what I did was this....

    @echo off
    REM Batch file stuff goes here
    CLS
    @@@@@@@

    There. The @ symbols represent white space, or a brand new line with nothing on it. That was the way I was able to get the batch file version to close automatically. With C code, there was a similar way.
    The world is waiting. I must leave you now.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Learning Dos and learning Windows
    By blankstare77 in forum C++ Programming
    Replies: 8
    Last Post: 07-31-2005, 03:48 PM
  2. getting to true DOS with windows NT
    By major_small in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 11-05-2003, 05:23 PM
  3. real mode dos & win dos
    By scott27349 in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 08-19-2002, 06:15 AM
  4. DOS program versus DOS console program
    By scromer in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 01-10-2002, 01:42 PM
  5. Shut off DOS screen automatically to Windows
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-08-2001, 07:14 PM