Commit 8248d0ae authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

Always return MA_ACTIVATE for WM_MOUSEACTIVATE in DefWindowProc.

parent 7d8e377a
......@@ -453,8 +453,8 @@ static LRESULT DEFWND_DefWinProc( HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa
if (ret) return ret;
}
/* Caption clicks are handled by the NC_HandleNCLButtonDown() */
return (LOWORD(lParam) >= HTCLIENT) ? MA_ACTIVATE : MA_NOACTIVATE;
/* Caption clicks are handled by NC_HandleNCLButtonDown() */
return MA_ACTIVATE;
case WM_ACTIVATE:
/* The default action in Windows is to set the keyboard focus to
......
......@@ -2264,6 +2264,7 @@ static void test_mouse_input(HWND hwnd)
HWND popup;
MSG msg;
BOOL ret;
LRESULT res;
ShowWindow(hwnd, SW_SHOW);
UpdateWindow(hwnd);
......@@ -2374,6 +2375,39 @@ static void test_mouse_input(HWND hwnd)
ok(msg.hwnd == popup && msg.message == WM_LBUTTONUP, "hwnd %p message %04x\n", msg.hwnd, msg.message);
ok(PeekMessageA(&msg, 0, 0, 0, PM_REMOVE), "no message available\n");
/* Test WM_MOUSEACTIVATE */
#define TEST_MOUSEACTIVATE(A,B) \
res = SendMessageA(hwnd, WM_MOUSEACTIVATE, (WPARAM)hwnd, (LPARAM)MAKELRESULT(A,0)); \
ok(res == B, "WM_MOUSEACTIVATE for %s returned %ld\n", #A, res);
TEST_MOUSEACTIVATE(HTERROR,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTTRANSPARENT,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTNOWHERE,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTCLIENT,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTCAPTION,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTSYSMENU,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTSIZE,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTMENU,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTHSCROLL,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTVSCROLL,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTMINBUTTON,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTMAXBUTTON,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTLEFT,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTRIGHT,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTTOP,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTTOPLEFT,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTTOPRIGHT,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTBOTTOM,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTBOTTOMLEFT,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTBOTTOMRIGHT,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTBORDER,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTOBJECT,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTCLOSE,MA_ACTIVATE);
TEST_MOUSEACTIVATE(HTHELP,MA_ACTIVATE);
/* Clear any messages left behind by WM_MOUSEACTIVATE tests */
while (PeekMessageA(&msg, 0, 0, 0, PM_REMOVE)) DispatchMessageA(&msg);
DestroyWindow(popup);
}
......
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