36 bool has_inherited_console()
38#if defined(_WIN32) && defined(WITH_WIN_CONSOLE)
39 const int file = _fileno(stdin);
40 const int tty = _isatty(file);
41 DWORD processes[2] = { 0 };
42 const DWORD count = GetConsoleProcessList(processes, ARRAYSIZE(processes));
44 return (tty != 0) && (count > 1);
50 void release_transient_console()
52#if defined(_WIN32) && defined(WITH_WIN_CONSOLE)
53 if (has_inherited_console())
56 if (
const HWND hwndConsole = GetConsoleWindow())
57 ShowWindow(hwndConsole, SW_HIDE);