From f29823a0d3d934c90569e668785cd8965df7ffa4 Mon Sep 17 00:00:00 2001 From: Jan Date: Fri, 28 Jun 2024 00:37:26 +0200 Subject: Check for Console Window before allocating one (#741) Check for Console Window before allocating one and remove "console already exists" from error message, we know it doesn't --- primedev/logging/logging.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/primedev/logging/logging.cpp b/primedev/logging/logging.cpp index 72171e25..4367b384 100644 --- a/primedev/logging/logging.cpp +++ b/primedev/logging/logging.cpp @@ -124,9 +124,9 @@ void CustomSink::custom_log(const custom_log_msg& msg) void InitialiseConsole() { - if (AllocConsole() == FALSE) + if (GetConsoleWindow() == NULL && AllocConsole() == FALSE) { - std::cout << "[*] Failed to create a console window, maybe a console already exists?" << std::endl; + std::cout << "[*] Failed to create a console window" << std::endl; } else { -- cgit v1.2.3