IsConsoleOpen

Just starting out? Need help? Post your questions and find answers here.
Jeromyal
Enthusiast
Enthusiast
Posts: 204
Joined: Wed Jul 17, 2013 8:49 am

IsConsoleOpen

Post by Jeromyal »

I have discovered at least with windows that you can detect if the console is open if a code page exists.
example:
If GetConsoleOutputCP_()
in certain rare situations this is useful to know, to avoid using other console commands and cause an error if one isn't open.

but is there a cross platform solution to test if your program has an open console?
User avatar
Mijikai
Addict
Addict
Posts: 1360
Joined: Sun Sep 11, 2016 2:17 pm

Re: IsConsoleOpen

Post by Mijikai »

On Windows there is also GetConsoleWindow() (which needs to be imported manually).
No idea about other OSes.
Post Reply