On 2/23/07, Felix Nawothnig <flexo(a)holycrap.org> wrote:
> Passed on XP SP2.
> ---
> dlls/comctl32/tests/listview.c | 209
> +++++++++++++++++++++++++++++++++++++++-
> dlls/comctl32/tests/msg.c | 3 +
> dlls/comctl32/tests/msg.h | 3 +-
> 3 files changed, 211 insertions(+), 4 deletions(-)
>
This is wrong:
+static LRESULT WINAPI header_subclass_proc(HWND hwnd, UINT message,
WPARAM wParam, LPARAM lParam)
+{
+ struct subclass_info *info = (struct subclass_info
*)GetWindowLongA(hwnd, GWL_USERDATA);
+ static long defwndproc_counter = 0;
+ LRESULT ret;
+ struct message msg;
+
+ trace("header: %p, %04x, %08x, %08lx\n", hwnd, message, wParam, lParam);
+
+ msg.message = message;
+ msg.flags = sent|wparam|lparam|hdr;
+ if (defwndproc_counter) msg.flags |= defwinproc;
+ msg.wParam = wParam;
+ msg.lParam = lParam;
+ add_message(sequences, LISTVIEW_SEQ_INDEX, &msg);
+
+ defwndproc_counter++;
+ ret = CallWindowProcA(info->oldproc, hwnd, message, wParam, lParam);
+ defwndproc_counter--;
+ return ret;
+}
If you're subclassing the header control and checking messages from
the header control, then you need to add another message sequence,
HEADER_SEQ_INDEX.
--- a/dlls/comctl32/tests/msg.c
+++ b/dlls/comctl32/tests/msg.c
@@ -158,6 +158,9 @@ void ok_sequence_(struct msg_sequence **
ok_(file, line) ((expected->flags & winevent_hook) ==
(actual->flags & winevent_hook),
"%s: the msg 0x%04x should have been sent by a
winevent hook\n",
context, expected->message);
+ ok_(file, line) ((expected->flags & hdr) == (actual->flags & hdr),
+ "%s: the msg 0x%04x should have been sent by the
header control\n",
+ context, expected->message);
expected++;
actual++;
}
msg.c is the message sequence testing code abstracted...keyword is
abstraction. Nothing in msg.c should know anything about specific
types of controls.
--
James Hawkins