From: Paul Gofman pgofman@codeweavers.com
--- dlls/user32/msgbox.c | 6 ++++-- dlls/user32/tests/dialog.c | 3 +-- 2 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/dlls/user32/msgbox.c b/dlls/user32/msgbox.c index 4a14a868c73..4d345777a10 100644 --- a/dlls/user32/msgbox.c +++ b/dlls/user32/msgbox.c @@ -110,10 +110,12 @@ static void MSGBOX_OnInit(HWND hwnd, LPMSGBOXPARAMSW lpmb) }
/* handle modal message boxes */ - if (((lpmb->dwStyle & MB_TASKMODAL) && (lpmb->hwndOwner==NULL))) - NtUserSetWindowPos( hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE ); + if (lpmb->dwStyle & MB_TASKMODAL && lpmb->hwndOwner == NULL) + NtUserSetWindowPos( hwnd, lpmb->dwStyle & MB_TOPMOST ? HWND_TOPMOST : HWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE ); else if (lpmb->dwStyle & MB_SYSTEMMODAL) NtUserSetWindowPos( hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED ); + else if (lpmb->dwStyle & MB_TOPMOST) + NtUserSetWindowPos( hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE );
TRACE_(msgbox)("%s\n", debugstr_w(lpszText)); SetWindowTextW(GetDlgItem(hwnd, MSGBOX_IDTEXT), lpszText); diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c index c3420b2b2d3..0df66f2121d 100644 --- a/dlls/user32/tests/dialog.c +++ b/dlls/user32/tests/dialog.c @@ -2147,8 +2147,7 @@ static LRESULT CALLBACK msgbox_hook_proc(INT code, WPARAM wParam, LPARAM lParam) if (!system_modal) expected_exstyles |= WS_EX_DLGMODALFRAME;
- todo_wine_if((system_modal && exstyles == (expected_exstyles | WS_EX_DLGMODALFRAME)) - || (!system_modal && msgbox_type & MB_TOPMOST)) + todo_wine_if(system_modal && exstyles == (expected_exstyles | WS_EX_DLGMODALFRAME)) ok(exstyles == expected_exstyles, "got %#lx, expected %#lx\n", exstyles, expected_exstyles);
text[0] = 0;