diff -r ba0ce5b958d2 src/video/windows/SDL_windowsmessagebox.c --- a/src/video/windows/SDL_windowsmessagebox.c Fri May 12 23:01:17 2017 +0200 +++ b/src/video/windows/SDL_windowsmessagebox.c Sat May 13 02:17:35 2017 +0200 @@ -354,6 +354,7 @@ wchar_t* wmessage; TEXTMETRIC TM; + HWND ParentWindow = NULL; const int ButtonWidth = 88; const int ButtonHeight = 26; @@ -469,8 +470,13 @@ x += ButtonWidth + ButtonMargin; } - /* FIXME: If we have a parent window, get the Instance and HWND for them */ - which = DialogBoxIndirect(NULL, (DLGTEMPLATE*)dialog->lpDialog, NULL, (DLGPROC)MessageBoxDialogProc); + /* If we have a parent window, get the Instance and HWND for them + * so that our little dialog gets exclusive focus at all times. */ + if (messageboxdata->window) + ParentWindow = ((SDL_WindowData*)messageboxdata->window->driverdata)->hwnd; + + + which = DialogBoxIndirect(NULL, (DLGTEMPLATE*)dialog->lpDialog, ParentWindow, (DLGPROC)MessageBoxDialogProc); *buttonid = buttons[which].buttonid; FreeDialogData(dialog);