View Full Version : from dos to windows

01-03-2003, 02:40 PM
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?


01-03-2003, 04:14 PM
Thanks, it worked!

01-05-2003, 04:27 PM
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

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.