[Issue 6880] Heisenbug: deferred crash when writing to stdout on Windows without console.

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Sun Jan 25 11:23:16 PST 2015


https://issues.dlang.org/show_bug.cgi?id=6880

--- Comment #7 from Vladimir Panteleev <thecybershadow at gmail.com> ---
You can detect if your program is running in a console with:

GetConsoleWindow() != NULL

However, this is probably not what you want - instead you want to check if
standard output is writable (you can probably create a GUI program and redirect
its output somewhere, and the program will work fine). I'm not sure how to do
that off the top of my head, though.

--


More information about the Digitalmars-d-bugs mailing list