Commit 18b5cc5e authored by Santino Mazza's avatar Santino Mazza Committed by Alexandre Julliard

user32/tests: Test for MB_SYSTEMMODAL.

parent 92e4cad8
...@@ -2151,6 +2151,25 @@ static LRESULT CALLBACK msgbox_hook_proc(INT code, WPARAM wParam, LPARAM lParam) ...@@ -2151,6 +2151,25 @@ static LRESULT CALLBACK msgbox_hook_proc(INT code, WPARAM wParam, LPARAM lParam)
return CallNextHookEx(NULL, code, wParam, 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) static void test_MessageBox(void)
{ {
HHOOK hook; HHOOK hook;
...@@ -2162,6 +2181,13 @@ static void test_MessageBox(void) ...@@ -2162,6 +2181,13 @@ static void test_MessageBox(void)
ok(ret == IDCANCEL, "got %d\n", ret); ok(ret == IDCANCEL, "got %d\n", ret);
UnhookWindowsHookEx(hook); 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) static INT_PTR CALLBACK custom_test_dialog_proc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment