mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-04 17:10:47 +00:00
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.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user