From 44eecdd76b750c7a8c802d5e3424aff0eb3dd776 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Wed, 9 Nov 2022 20:19:28 +0100 Subject: [PATCH] Fix error messages --- src/client/component/steam_proxy.cpp | 2 +- src/client/loader/loader.cpp | 2 +- src/client/main.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/client/component/steam_proxy.cpp b/src/client/component/steam_proxy.cpp index dd6253b8..1e8fba81 100644 --- a/src/client/component/steam_proxy.cpp +++ b/src/client/component/steam_proxy.cpp @@ -215,7 +215,7 @@ namespace steam_proxy catch (std::exception& e) { printf("Steam: %s\n", e.what()); - MessageBoxA(GetForegroundWindow(), e.what(), "BOIII Error", MB_ICONERROR); + MessageBoxA(nullptr, e.what(), "BOIII Error", MB_ICONERROR | MB_SETFOREGROUND | MB_TOPMOST); TerminateProcess(GetCurrentProcess(), 1234); } diff --git a/src/client/loader/loader.cpp b/src/client/loader/loader.cpp index 7d26f253..b6d55056 100644 --- a/src/client/loader/loader.cpp +++ b/src/client/loader/loader.cpp @@ -107,7 +107,7 @@ namespace loader const auto target = utils::nt::library::load(filename); if (!target) { - throw std::runtime_error{"Failed to map binary!"}; + throw std::runtime_error{"Failed to map: " + filename}; } load_imports(target); diff --git a/src/client/main.cpp b/src/client/main.cpp index eaffb08f..b5838de9 100644 --- a/src/client/main.cpp +++ b/src/client/main.cpp @@ -179,7 +179,7 @@ namespace } catch (std::exception& e) { - MessageBoxA(GetForegroundWindow(), e.what(), "ERROR", MB_ICONERROR); + MessageBoxA(nullptr, e.what(), "ERROR", MB_ICONERROR | MB_SETFOREGROUND | MB_TOPMOST); return 1; } }