From f0a08aea2213197a2b7e6b6784ec34320aa85abb Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sun, 25 Aug 2024 20:28:42 +1000 Subject: [PATCH] win: console if launching with debugger --- source/application/StarMainApplication.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/application/StarMainApplication.hpp b/source/application/StarMainApplication.hpp index 18c9fa5..5ba06e7 100644 --- a/source/application/StarMainApplication.hpp +++ b/source/application/StarMainApplication.hpp @@ -18,6 +18,10 @@ namespace Star { LPWSTR* argsList = CommandLineToArgvW(GetCommandLineW(), &nArgs); \ Star::StringList args; \ for (int i = 0; i < nArgs; ++i) args.append(Star::String(argsList[i])); \ + if (IsDebuggerPresent() && AllocConsole()) { \ + freopen("CONOUT$", "w", stdout); \ + freopen("CONOUT$", "w", stderr); \ + } \ return Star::runMainApplication(Star::make_unique(), args); \ }