From: Santino Mazza smazza@codeweavers.com
--- dlls/user32/tests/dialog.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
diff --git a/dlls/user32/tests/dialog.c b/dlls/user32/tests/dialog.c index 3df1a0eab32..b439b6f08c0 100644 --- a/dlls/user32/tests/dialog.c +++ b/dlls/user32/tests/dialog.c @@ -2151,6 +2151,25 @@ static LRESULT CALLBACK msgbox_hook_proc(INT code, WPARAM wParam, LPARAM lParam) return CallNextHookEx(NULL, code, wParam, lParam); }
+static LRESULT CALLBACK msgbox_sysmodal_hook_proc(INT code, WPARAM wParam, LPARAM lParam) +{ + if (code == HCBT_ACTIVATE) + { + HWND msgbox = (HWND)wParam; + LONG exstyles = GetWindowLongA(msgbox, GWL_EXSTYLE); + + if (msgbox) + { + todo_wine ok(exstyles & WS_EX_TOPMOST, "expected message box to have topmost exstyle set\n"); + + SendDlgItemMessageA(msgbox, IDCANCEL, WM_LBUTTONDOWN, 0, 0); + SendDlgItemMessageA(msgbox, IDCANCEL, WM_LBUTTONUP, 0, 0); + } + } + + return CallNextHookEx(NULL, code, wParam, lParam); +} + static void test_MessageBox(void) { HHOOK hook; @@ -2162,6 +2181,13 @@ static void test_MessageBox(void) ok(ret == IDCANCEL, "got %d\n", ret);
UnhookWindowsHookEx(hook); + + /* Test for MB_SYSTEMMODAL */ + hook = SetWindowsHookExA(WH_CBT, msgbox_sysmodal_hook_proc, NULL, GetCurrentThreadId()); + + MessageBoxA(NULL, NULL, "system modal", MB_OKCANCEL | MB_SYSTEMMODAL); + + UnhookWindowsHookEx(hook); }
static INT_PTR CALLBACK custom_test_dialog_proc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)