Module: wine Branch: master Commit: b34c21637682673ca9c822e13e915df52232db35 URL: https://gitlab.winehq.org/wine/wine/-/commit/b34c21637682673ca9c822e13e915df...
Author: Paul Gofman pgofman@codeweavers.com Date: Tue Aug 29 18:19:44 2023 -0600
user32/msgbox: Implement MB_TOPMOST.
---
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 99f52769e73..a24bfafd0b9 100644 --- a/dlls/user32/tests/dialog.c +++ b/dlls/user32/tests/dialog.c @@ -2149,8 +2149,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;