From cd671b5f12c6cd6fb7c7e51ed5ba0636b5e667f6 Mon Sep 17 00:00:00 2001 From: tildearrow Date: Thu, 15 Dec 2022 17:18:34 -0500 Subject: [PATCH] what? --- src/winMain.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/winMain.cpp b/src/winMain.cpp index 853b1153..c904b996 100644 --- a/src/winMain.cpp +++ b/src/winMain.cpp @@ -22,6 +22,10 @@ typedef HRESULT (*SPDA)(int); int WINAPI WinMain(HINSTANCE inst, HINSTANCE prevInst, PSTR args, int state) { + if (AttachConsole(ATTACH_PARENT_PROCESS)==0) { + if (GetLastError()==ERROR_ACCESS_DENIED) FreeConsole(); + } + int argc=0; wchar_t** argw=CommandLineToArgvW(GetCommandLineW(),&argc); char** argv=new char*[argc+1];