[clean-list] Termination of console programs under Windows

John van Groningen johnvg at cs.ru.nl
Wed May 7 17:35:25 MEST 2008


Norbert Zeh wrote:
>Thanks, this does exactly what I wanted, even though I don't even want to know what the cryptic pushes and pops in the code { ...} segment do ;)

It just makes the global variable console_flag non zero.

>  Do I understand it right that the effect of this is to have a connection to the open console to allow output to it while the program runs, but then, just before exiting, trick the runtime system into thinking that it was running in console-less mode and thus shouldn't wait for a keypress?

No, it tricks the runtime system into thinking it was started from a command
line window. If this is done immediately after the program has started, it also
prevents the runtime system from opening a new command line window, because such
a window is not created when the program starts, but the first time that
something is printed.

Kind regards,

John van Groningen


More information about the clean-list mailing list