[PATCH 1/3] user32: Test button parent messages.
Alex Henrie
alexhenrie24 at gmail.com
Mon Oct 12 02:30:49 CDT 2015
Signed-off-by: Alex Henrie <alexhenrie24 at gmail.com>
---
dlls/user32/tests/msg.c | 41 +++++++++++++++++++++++++----------------
1 file changed, 25 insertions(+), 16 deletions(-)
diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index d92fbc7..fcb231c 100644
--- a/dlls/user32/tests/msg.c
+++ b/dlls/user32/tests/msg.c
@@ -5293,9 +5293,11 @@ static const struct message WmLButtonDownSeq[] =
{ WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 },
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_SETFOCUS, sent|wparam|defwinproc, 0 },
- { WM_CTLCOLORBTN, sent|defwinproc },
+ { WM_CTLCOLORBTN, sent|parent },
+ { WM_DRAWITEM, sent|parent|optional }, /* FIXME: Wine sends it */
{ BM_SETSTATE, sent|wparam|defwinproc, TRUE },
- { WM_CTLCOLORBTN, sent|defwinproc },
+ { WM_CTLCOLORBTN, sent|parent },
+ { WM_DRAWITEM, sent|parent|optional }, /* FIXME: Wine sends it */
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ 0 }
};
@@ -5308,9 +5310,9 @@ static const struct message WmLButtonDownStaticSeq[] =
{ WM_IME_NOTIFY, sent|wparam|defwinproc|optional, 2 },
{ EVENT_OBJECT_FOCUS, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ WM_SETFOCUS, sent|wparam|defwinproc, 0 },
- { WM_CTLCOLORSTATIC, sent|defwinproc },
+ { WM_CTLCOLORSTATIC, sent|parent },
{ BM_SETSTATE, sent|wparam|defwinproc, TRUE },
- { WM_CTLCOLORSTATIC, sent|defwinproc },
+ { WM_CTLCOLORSTATIC, sent|parent },
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ 0 }
};
@@ -5318,9 +5320,11 @@ static const struct message WmLButtonUpSeq[] =
{
{ WM_LBUTTONUP, sent|wparam|lparam, 0, 0 },
{ BM_SETSTATE, sent|wparam|defwinproc, FALSE },
- { WM_CTLCOLORBTN, sent|defwinproc },
+ { WM_CTLCOLORBTN, sent|parent },
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 },
+ { WM_DRAWITEM, sent|parent|optional }, /* FIXME: Wine sends it */
+ { WM_COMMAND, sent|parent|optional }, /* FIXME: Wine sends it */
{ WM_CAPTURECHANGED, sent|wparam|defwinproc, 0 },
{ 0 }
};
@@ -5328,9 +5332,11 @@ static const struct message WmLButtonUpStaticSeq[] =
{
{ WM_LBUTTONUP, sent|wparam|lparam, 0, 0 },
{ BM_SETSTATE, sent|wparam|defwinproc, FALSE },
- { WM_CTLCOLORSTATIC, sent|defwinproc },
+ { WM_CTLCOLORSTATIC, sent|parent },
+ { WM_DRAWITEM, sent|parent|optional }, /* FIXME: Wine sends it */
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 },
+ { WM_COMMAND, sent|parent|optional }, /* FIXME: Wine sends it */
{ WM_CAPTURECHANGED, sent|wparam|defwinproc, 0 },
{ 0 }
};
@@ -5338,11 +5344,13 @@ static const struct message WmLButtonUpAutoSeq[] =
{
{ WM_LBUTTONUP, sent|wparam|lparam, 0, 0 },
{ BM_SETSTATE, sent|wparam|defwinproc, FALSE },
- { WM_CTLCOLORSTATIC, sent|defwinproc },
+ { WM_CTLCOLORSTATIC, sent|parent },
+ { WM_DRAWITEM, sent|parent|optional }, /* FIXME: Wine sends it */
{ EVENT_OBJECT_STATECHANGE, winevent_hook|wparam|lparam, OBJID_CLIENT, 0 },
{ EVENT_SYSTEM_CAPTUREEND, winevent_hook|wparam|lparam, 0, 0 },
{ BM_SETCHECK, sent|defwinproc },
- { WM_CTLCOLORSTATIC, sent|defwinproc, 0, 0 },
+ { WM_CTLCOLORSTATIC, sent|parent, 0, 0 },
+ { WM_COMMAND, sent|parent|optional }, /* FIXME: Wine sends it */
{ WM_CAPTURECHANGED, sent|wparam|defwinproc, 0 },
{ 0 }
};
@@ -5356,8 +5364,9 @@ static const struct message WmSetFontButtonSeq[] =
{ WM_SETFONT, sent },
{ WM_PAINT, sent },
{ WM_ERASEBKGND, sent|defwinproc|optional },
- { WM_CTLCOLORBTN, sent|defwinproc },
- { WM_CTLCOLORBTN, sent|defwinproc|optional }, /* FIXME: Wine sends it twice for BS_OWNERDRAW */
+ { WM_CTLCOLORBTN, sent|parent },
+ { WM_CTLCOLORBTN, sent|parent|optional }, /* FIXME: Wine sends it twice for BS_OWNERDRAW */
+ { WM_DRAWITEM, sent|parent|optional }, /* FIXME: Wine sends it */
{ 0 }
};
static const struct message WmSetFontStaticSeq[] =
@@ -5365,7 +5374,7 @@ static const struct message WmSetFontStaticSeq[] =
{ WM_SETFONT, sent },
{ WM_PAINT, sent },
{ WM_ERASEBKGND, sent|defwinproc|optional },
- { WM_CTLCOLORSTATIC, sent|defwinproc },
+ { WM_CTLCOLORSTATIC, sent|parent },
{ 0 }
};
static const struct message WmSetStyleButtonSeq[] =
@@ -5605,6 +5614,8 @@ static void test_button_messages(void)
100, 100, 200, 200, 0, 0, 0, NULL);
ok(parent != 0, "Failed to create parent window\n");
+ log_all_parent_messages++;
+
for (i = 0; i < sizeof(button)/sizeof(button[0]); i++)
{
MSG msg;
@@ -5635,8 +5646,6 @@ static void test_button_messages(void)
SetFocus(0);
flush_sequence();
- log_all_parent_messages++;
-
ok(GetFocus() == 0, "expected focus 0, got %p\n", GetFocus());
SetFocus(hwnd);
SendMessageA(hwnd, WM_APP, 0, 0); /* place a separator mark here */
@@ -5733,12 +5742,10 @@ static void test_button_messages(void)
else
ok(style == button[i].style, "expected style %04x got %04x\n", button[i].style, style);
- log_all_parent_messages--;
-
DestroyWindow(hwnd);
hwnd = CreateWindowExA(0, "my_button_class", "test", button[i].style | WS_POPUP | WS_VISIBLE,
- 0, 0, 50, 14, 0, 0, 0, NULL);
+ 0, 0, 50, 14, parent, 0, 0, NULL);
ok(hwnd != 0, "Failed to create button window\n");
SetForegroundWindow(hwnd);
@@ -5769,6 +5776,8 @@ static void test_button_messages(void)
DestroyWindow(hwnd);
}
+ log_all_parent_messages--;
+
DestroyWindow(parent);
}
--
2.6.1
More information about the wine-patches
mailing list