MUtilities development repository
Revision | b6091380a65b0d3b26e40be98f0c34c94a28e048 (tree) |
---|---|
Zeit | 2021-05-29 11:04:56 |
Autor | ![]() |
Commiter | LoRd_MuldeR |
In fatal_exit() function: Clear the TOPMOST attribute of all windows, before showing the message box.
@@ -2012,10 +2012,10 @@ static volatile bool g_debug_check = check_debugger_helper(); | ||
2012 | 2012 | static MUtils::Internal::CriticalSection g_fatal_exit_lock; |
2013 | 2013 | static QAtomicInt g_fatal_exit_flag; |
2014 | 2014 | |
2015 | -static DWORD WINAPI fatal_exit_helper(LPVOID lpParameter) | |
2015 | +static BOOL CALLBACK fatal_exit_enum_helper(const HWND hwnd, const LPARAM lParam) | |
2016 | 2016 | { |
2017 | - MUtils::OS::system_message_err(L"GURU MEDITATION", (LPWSTR) lpParameter); | |
2018 | - return 0; | |
2017 | + SetWindowPos(hwnd, HWND_NOTOPMOST, NULL, NULL, NULL, NULL, SWP_ASYNCWINDOWPOS | SWP_NOMOVE | SWP_NOSIZE); | |
2018 | + return TRUE; | |
2019 | 2019 | } |
2020 | 2020 | |
2021 | 2021 | void MUtils::OS::fatal_exit(const wchar_t* const errorMessage) |
@@ -2027,6 +2027,8 @@ void MUtils::OS::fatal_exit(const wchar_t* const errorMessage) | ||
2027 | 2027 | return; /*prevent recursive invocation*/ |
2028 | 2028 | } |
2029 | 2029 | |
2030 | + EnumThreadWindows(g_main_thread_id, fatal_exit_enum_helper, 0L); | |
2031 | + | |
2030 | 2032 | if(g_main_thread_id != GetCurrentThreadId()) |
2031 | 2033 | { |
2032 | 2034 | if(HANDLE hThreadMain = OpenThread(THREAD_SUSPEND_RESUME, FALSE, g_main_thread_id)) |
@@ -2035,14 +2037,7 @@ void MUtils::OS::fatal_exit(const wchar_t* const errorMessage) | ||
2035 | 2037 | } |
2036 | 2038 | } |
2037 | 2039 | |
2038 | - if(HANDLE hThread = CreateThread(NULL, 0, fatal_exit_helper, (LPVOID)errorMessage, 0, NULL)) | |
2039 | - { | |
2040 | - WaitForSingleObject(hThread, INFINITE); | |
2041 | - } | |
2042 | - else | |
2043 | - { | |
2044 | - fatal_exit_helper((LPVOID)errorMessage); | |
2045 | - } | |
2040 | + MUtils::OS::system_message_err(L"GURU MEDITATION", errorMessage); | |
2046 | 2041 | |
2047 | 2042 | for(;;) |
2048 | 2043 | { |