From 4b601f15c75ff564476576f4d2f663f90967d8e7 Mon Sep 17 00:00:00 2001 From: marzent Date: Fri, 16 Feb 2024 22:19:10 +0100 Subject: [PATCH] Merge pull request #1660 * make extra sure progress dialog crash handler is in the foregroud --- Dalamud.Boot/veh.cpp | 2 ++ DalamudCrashHandler/DalamudCrashHandler.cpp | 1 + 2 files changed, 3 insertions(+) diff --git a/Dalamud.Boot/veh.cpp b/Dalamud.Boot/veh.cpp index 4eeddba88..ade295d02 100644 --- a/Dalamud.Boot/veh.cpp +++ b/Dalamud.Boot/veh.cpp @@ -188,6 +188,8 @@ LONG exception_handler(EXCEPTION_POINTERS* ex) if (DWORD written; !WriteFile(g_crashhandler_pipe_write, &g_startInfo.TroubleshootingPackData[0], static_cast(std::span(g_startInfo.TroubleshootingPackData).size_bytes()), &written, nullptr) || std::span(g_startInfo.TroubleshootingPackData).size_bytes() != written) return EXCEPTION_CONTINUE_SEARCH; + AllowSetForegroundWindow(GetProcessId(g_crashhandler_process)); + HANDLE waitHandles[] = { g_crashhandler_process, g_crashhandler_event }; DWORD waitResult = WaitForMultipleObjects(2, waitHandles, FALSE, INFINITE); diff --git a/DalamudCrashHandler/DalamudCrashHandler.cpp b/DalamudCrashHandler/DalamudCrashHandler.cpp index 258ec923d..09e14d722 100644 --- a/DalamudCrashHandler/DalamudCrashHandler.cpp +++ b/DalamudCrashHandler/DalamudCrashHandler.cpp @@ -773,6 +773,7 @@ int main() { { SetWindowPos(hwndProgressDialog, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_SHOWWINDOW); + SetForegroundWindow(hwndProgressDialog); } pOleWindow->Release();