Waritnan Sookbuntherng lion328@hotmail.co.th writes:
Signed-off-by: Waritnan Sookbuntherng lion328@hotmail.co.th
v2: Add tests. v3: Cover more points.
dlls/comctl32/tests/status.c | 85 ++++++++++++++++++++++++++++++++++++ 1 file changed, 85 insertions(+)
diff --git a/dlls/comctl32/tests/status.c b/dlls/comctl32/tests/status.c index d78bd20262..074e637801 100644 --- a/dlls/comctl32/tests/status.c +++ b/dlls/comctl32/tests/status.c @@ -20,6 +20,7 @@
#include <windows.h> #include <commctrl.h> +#include <uxtheme.h>
#include "wine/test.h"
@@ -586,6 +587,89 @@ static void test_notify(void) ok(g_got_contextmenu, "WM_RBUTTONUP did not activate the context menu!\n"); }
+static void test_sizegrip(void) +{
- HWND hwndStatus;
- LONG style;
- RECT rcClient, rcGripper;
- POINT pt;
- int width, r;
- hwndStatus = CreateWindowA(SUBCLASS_NAME, "", WS_CHILD|WS_VISIBLE|SBARS_SIZEGRIP,
0, 0, 100, 100, g_hMainWnd, NULL, NULL, NULL);
- style = GetWindowLongPtrA(g_hMainWnd, GWL_STYLE);
- GetClientRect(hwndStatus, &rcClient);
- width = GetSystemMetrics(SM_CXVSCROLL);
- rcGripper = rcClient;
- rcGripper.left = rcClient.right - width;
+#define SETWNDLONG(MAXIMIZE, RTL) \
do \
{ \
SetWindowLongA(g_hMainWnd, GWL_STYLE, (MAXIMIZE) ? style|WS_MAXIMIZE : style); \
SetWindowLongA(hwndStatus, GWL_EXSTYLE, (RTL) ? WS_EX_LAYOUTRTL : 0); \
} while (0)
+#define TEST_NCHITTEST(X, Y, EXPECT) \
do \
{ \
pt.x = (X); \
pt.y = (Y); \
ClientToScreen(hwndStatus, &pt); \
r = SendMessageA(hwndStatus, WM_NCHITTEST, 0, MAKELPARAM(pt.x, pt.y)); \
ok((EXPECT) == r, "expect WM_NCHITTEST " #EXPECT " got %#x\n", r); \
} while (0)
It would look better without the macros. You don't need to do ClientToScreen() every time, so it's basically a bunch of SendMessage+ok() calls, you can write them directly without a macro.