[PATCH] user32/static: Return MA_NOACTIVATE for WM_MOUSEACTIVATE message
Alistair Leslie-Hughes
leslie_alistair at hotmail.com
Thu Oct 24 05:45:15 CDT 2019
Signed-off-by: Alistair Leslie-Hughes <leslie_alistair at hotmail.com>
---
dlls/user32/static.c | 3 +++
dlls/user32/tests/static.c | 21 +++++++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/dlls/user32/static.c b/dlls/user32/static.c
index 1f7c03121c3..1e74f92a3fd 100644
--- a/dlls/user32/static.c
+++ b/dlls/user32/static.c
@@ -493,6 +493,9 @@ LRESULT StaticWndProc_common( HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam
MAKEWPARAM( GetWindowLongPtrW(hwnd,GWLP_ID), STN_DBLCLK ), (LPARAM)hwnd);
return 0;
+ case WM_MOUSEACTIVATE:
+ return MA_NOACTIVATE;
+
case STM_GETIMAGE:
return (LRESULT)STATIC_GetImage( hwnd, wParam, full_style );
diff --git a/dlls/user32/tests/static.c b/dlls/user32/tests/static.c
index 8776c3a9e07..91e2a5b32e7 100644
--- a/dlls/user32/tests/static.c
+++ b/dlls/user32/tests/static.c
@@ -130,6 +130,26 @@ static void test_set_text(void)
DestroyWindow(hStatic);
}
+static void test_mouse_activate(void)
+{
+ LRESULT ma;
+ HWND hStatic = build_static(SS_SIMPLE);
+
+ ma = SendMessageW( hStatic, WM_MOUSEACTIVATE, (WPARAM)GetAncestor( hStatic, GA_ROOT ),
+ MAKELONG(HTCAPTION,WM_LBUTTONDOWN) );
+ ok(ma == MA_NOACTIVATE, "got %d\n", ma);
+
+ DestroyWindow(hStatic);
+
+ hStatic = CreateWindowA("static", "Test2", WS_VISIBLE, 5, 5, 100, 100, NULL, NULL, NULL, NULL);
+
+ ma = SendMessageW( hStatic, WM_MOUSEACTIVATE, (WPARAM)GetAncestor( hStatic, GA_ROOT ),
+ MAKELONG(HTCAPTION,WM_LBUTTONDOWN) );
+ ok(ma == MA_NOACTIVATE, "got %d\n", ma);
+
+ DestroyWindow(hStatic);
+}
+
START_TEST(static)
{
static const char szClassName[] = "testclass";
@@ -162,6 +182,7 @@ START_TEST(static)
test_updates(SS_ETCHEDHORZ, TODO_COUNT);
test_updates(SS_ETCHEDVERT, TODO_COUNT);
test_set_text();
+ test_mouse_activate();
DestroyWindow(hMainWnd);
}
--
2.23.0
More information about the wine-devel
mailing list