From 8b5f3de9165cacf153b7e5e982483a106bc73ede Mon Sep 17 00:00:00 2001 From: baldurk Date: Mon, 1 Aug 2016 14:56:21 +0200 Subject: [PATCH] As DS_SETFOREGROUND doesn't work, move error reporter in/out of topmost * This will guarantee the window is brought to the front, but it won't keep it there and be annoying. --- renderdoccmd/renderdoccmd_win32.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/renderdoccmd/renderdoccmd_win32.cpp b/renderdoccmd/renderdoccmd_win32.cpp index 2c49058884..8336b737ec 100644 --- a/renderdoccmd/renderdoccmd_win32.cpp +++ b/renderdoccmd/renderdoccmd_win32.cpp @@ -106,6 +106,18 @@ INT_PTR CALLBACK CrashHandlerProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM CheckDlgButton(hDlg, IDC_SENDDUMP, BST_CHECKED); CheckDlgButton(hDlg, IDC_SENDLOG, BST_CHECKED); + + { + RECT r; + GetClientRect(hDlg, &r); + + int xPos = (GetSystemMetrics(SM_CXSCREEN) - r.right) / 2; + int yPos = (GetSystemMetrics(SM_CYSCREEN) - r.bottom) / 2; + + SetWindowPos(hDlg, HWND_TOPMOST, xPos, yPos, 0, 0, SWP_NOSIZE); + } + + return (INT_PTR)TRUE; } case WM_SHOWWINDOW: @@ -117,7 +129,7 @@ INT_PTR CALLBACK CrashHandlerProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM int xPos = (GetSystemMetrics(SM_CXSCREEN) - r.right) / 2; int yPos = (GetSystemMetrics(SM_CYSCREEN) - r.bottom) / 2; - SetWindowPos(hDlg, NULL, xPos, yPos, 0, 0, SWP_NOZORDER | SWP_NOSIZE); + SetWindowPos(hDlg, HWND_NOTOPMOST, xPos, yPos, 0, 0, SWP_NOSIZE); } return (INT_PTR)TRUE;