try to fix console mode on Windows

issue #643
This commit is contained in:
tildearrow 2023-02-13 19:26:37 -05:00
parent 9f48bda59a
commit 9cdc330a48

View file

@ -342,6 +342,14 @@ void reportError(String what) {
// TODO: CoInitializeEx on Windows?
// TODO: add crash log
int main(int argc, char** argv) {
// Windows console thing - thanks MarioKart7z!
#ifdef _WIN32
DWORD winPID;
HWND winConsole=GetConsoleWindow();
GetWindowThreadProcessId(winConsole,&winPID);
if (GetCurrentProcessId()==winPID) FreeConsole();
#endif
initLog();
#ifdef _WIN32
// set DPI awareness