* Sync with Wine 1.7.27.
CORE-8540
svn path=/trunk/; revision=64323
ok(lstrcmpW(nameW, WC_BUTTONW), "got %s\n", wine_dbgstr_w(nameW));
ret = GetClassInfoExW(NULL, nameW, &ex2W);
-todo_wine {
+todo_wine
ok(ret, "got %d\n", ret);
+if (ret) /* TODO: remove once Wine is fixed */
ok(ex2W.lpfnWndProc == exW.lpfnWndProc, "got %p, %p\n", exW.lpfnWndProc, ex2W.lpfnWndProc);
-}
/* Check reported class name */
hwnd = create_button(BS_CHECKBOX, NULL);
static void test_iimagelist(void)
{
IImageList *imgl, *imgl2;
+ IImageList2 *imagelist;
HIMAGELIST himl;
HRESULT hr;
ULONG ret;
IImageList_Release(imgl);
ImageList_Destroy(himl);
+
+ /* IImageList2 */
+ hr = pImageList_CoCreateInstance(&CLSID_ImageList, NULL, &IID_IImageList2, (void**)&imagelist);
+ if (hr != S_OK)
+ {
+ win_skip("IImageList2 is not supported.\n");
+ return;
+ }
+ ok(hr == S_OK, "got 0x%08x\n", hr);
+ IImageList2_Release(imagelist);
}
static void test_hotspot_v6(void)
*
* Copyright 2006 Mike McCormack for CodeWeavers
* Copyright 2007 George Gov
- * Copyright 2009-2013 Nikolay Sivov
+ * Copyright 2009-2014 Nikolay Sivov
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
#include "v6util.h"
#include "msg.h"
-#define PARENT_SEQ_INDEX 0
-#define PARENT_FULL_SEQ_INDEX 1
-#define LISTVIEW_SEQ_INDEX 2
-#define EDITBOX_SEQ_INDEX 3
-#define COMBINED_SEQ_INDEX 4
-#define NUM_MSG_SEQUENCES 5
+enum seq_index {
+ PARENT_SEQ_INDEX,
+ PARENT_FULL_SEQ_INDEX,
+ PARENT_CD_SEQ_INDEX,
+ LISTVIEW_SEQ_INDEX,
+ EDITBOX_SEQ_INDEX,
+ COMBINED_SEQ_INDEX,
+ NUM_MSG_SEQUENCES
+};
#define LISTVIEW_ID 0
#define HEADER_ID 1
{ 0 }
};
+static const struct message parent_report_cd_seq[] = {
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_PREPAINT },
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPREPAINT },
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPREPAINT|CDDS_SUBITEM },
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPOSTPAINT|CDDS_SUBITEM },
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPREPAINT|CDDS_SUBITEM },
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPOSTPAINT|CDDS_SUBITEM },
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPOSTPAINT },
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_POSTPAINT },
+ { 0 }
+};
+
+static const struct message parent_list_cd_seq[] = {
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_PREPAINT },
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPREPAINT },
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPOSTPAINT },
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_POSTPAINT },
+ { 0 }
+};
+
static LRESULT WINAPI parent_wnd_proc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
static LONG defwndproc_counter = 0;
DestroyWindow(hwnd);
}
-static LRESULT WINAPI cd_wndproc(HWND hwnd, UINT msg, WPARAM wp, LPARAM lp)
+static LRESULT WINAPI cd_wndproc(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
COLORREF clr, c0ffee = RGB(0xc0, 0xff, 0xee);
- if(msg == WM_NOTIFY) {
- NMHDR *nmhdr = (PVOID)lp;
+ if(message == WM_NOTIFY) {
+ NMHDR *nmhdr = (NMHDR*)lParam;
if(nmhdr->code == NM_CUSTOMDRAW) {
NMLVCUSTOMDRAW *nmlvcd = (NMLVCUSTOMDRAW*)nmhdr;
+ struct message msg;
+
+ msg.message = message;
+ msg.flags = sent|wparam|lparam|custdraw;
+ msg.wParam = wParam;
+ msg.lParam = lParam;
+ msg.id = nmhdr->code;
+ msg.stage = nmlvcd->nmcd.dwDrawStage;
+ add_message(sequences, PARENT_CD_SEQ_INDEX, &msg);
switch(nmlvcd->nmcd.dwDrawStage) {
case CDDS_PREPAINT:
SetBkColor(nmlvcd->nmcd.hdc, c0ffee);
- return CDRF_NOTIFYITEMDRAW;
+ return CDRF_NOTIFYITEMDRAW|CDRF_NOTIFYPOSTPAINT;
case CDDS_ITEMPREPAINT:
nmlvcd->clrTextBk = CLR_DEFAULT;
- return CDRF_NOTIFYSUBITEMDRAW;
+ nmlvcd->clrText = RGB(0, 255, 0);
+ return CDRF_NOTIFYSUBITEMDRAW|CDRF_NOTIFYPOSTPAINT;
case CDDS_ITEMPREPAINT | CDDS_SUBITEM:
clr = GetBkColor(nmlvcd->nmcd.hdc);
+ ok(nmlvcd->clrTextBk == CLR_DEFAULT, "got 0x%x\n", nmlvcd->clrTextBk);
+ ok(nmlvcd->clrText == RGB(0, 255, 0), "got 0x%x\n", nmlvcd->clrText);
if (nmlvcd->iSubItem)
todo_wine ok(clr == c0ffee, "clr=%.8x\n", clr);
else
case CDDS_ITEMPOSTPAINT | CDDS_SUBITEM:
clr = GetBkColor(nmlvcd->nmcd.hdc);
todo_wine ok(clr == c0ffee, "clr=%.8x\n", clr);
+ ok(nmlvcd->clrTextBk == CLR_DEFAULT, "got 0x%x\n", nmlvcd->clrTextBk);
+ ok(nmlvcd->clrText == RGB(0, 255, 0), "got 0x%x\n", nmlvcd->clrText);
return CDRF_DODEFAULT;
}
return CDRF_DODEFAULT;
}
}
- return DefWindowProcA(hwnd, msg, wp, lp);
+ return DefWindowProcA(hwnd, message, wParam, lParam);
}
static void test_customdraw(void)
InvalidateRect(hwnd, NULL, TRUE);
UpdateWindow(hwnd);
- SetWindowLongPtrA(hwndparent, GWLP_WNDPROC, (LONG_PTR)oldwndproc);
+ /* message tests */
+ flush_sequences(sequences, NUM_MSG_SEQUENCES);
+ InvalidateRect(hwnd, NULL, TRUE);
+ UpdateWindow(hwnd);
+ ok_sequence(sequences, PARENT_CD_SEQ_INDEX, parent_report_cd_seq, "parent customdraw, LVS_REPORT", FALSE);
DestroyWindow(hwnd);
+
+ hwnd = create_listview_control(LVS_LIST);
+
+ insert_column(hwnd, 0);
+ insert_column(hwnd, 1);
+ insert_item(hwnd, 0);
+
+ flush_sequences(sequences, NUM_MSG_SEQUENCES);
+ InvalidateRect(hwnd, NULL, TRUE);
+ UpdateWindow(hwnd);
+ ok_sequence(sequences, PARENT_CD_SEQ_INDEX, parent_list_cd_seq, "parent customdraw, LVS_LIST", FALSE);
+
+ SetWindowLongPtrA(hwndparent, GWLP_WNDPROC, (LONG_PTR)oldwndproc);
+ DestroyWindow(hwnd);
}
static void test_icon_spacing(void)
optional = 0x80,
hook = 0x100,
winevent_hook =0x200,
- id = 0x400
+ id = 0x400,
+ custdraw = 0x800
} msg_flags_t;
struct message
LPARAM lParam; /* expected value of lParam */
UINT id; /* extra message data: id of the window,
notify code etc. */
+ DWORD stage; /* custom draw stage */
};
struct msg_sequence
assert(msg_seq->sequence);
- msg_seq->sequence[msg_seq->count].message = msg->message;
- msg_seq->sequence[msg_seq->count].flags = msg->flags;
- msg_seq->sequence[msg_seq->count].wParam = msg->wParam;
- msg_seq->sequence[msg_seq->count].lParam = msg->lParam;
- msg_seq->sequence[msg_seq->count].id = msg->id;
-
+ msg_seq->sequence[msg_seq->count] = *msg;
msg_seq->count++;
}
flush_sequence(seq, i);
}
+static void dump_sequence( struct msg_sequence **seq, int sequence_index,
+ const struct message *expected, const char *context,
+ const char *file, int line )
+{
+ struct msg_sequence *msg_seq = seq[sequence_index];
+ const struct message *actual, *sequence;
+ unsigned int count = 0;
+
+ sequence = msg_seq->sequence;
+ actual = sequence;
+
+ trace_(file, line)("Failed sequence %s:\n", context );
+ while (expected->message && actual->message)
+ {
+ trace_(file, line)( " %u: expected: %04x - actual: %04x wp %08lx lp %08lx\n",
+ count, expected->message, actual->message, actual->wParam, actual->lParam );
+
+ if (expected->message == actual->message)
+ {
+ if ((expected->flags & defwinproc) != (actual->flags & defwinproc) &&
+ (expected->flags & optional))
+ {
+ /* don't match messages if their defwinproc status differs */
+ expected++;
+ }
+ else
+ {
+ expected++;
+ actual++;
+ }
+ }
+ else
+ {
+ expected++;
+ actual++;
+ }
+ count++;
+ }
+
+ /* optional trailing messages */
+ while (expected->message && expected->flags & optional)
+ {
+ trace_(file, line)( " %u: expected: msg %04x - actual: nothing\n", count, expected->message );
+ expected++;
+ count++;
+ }
+
+ if (expected->message)
+ {
+ trace_(file, line)( " %u: expected: msg %04x - actual: nothing\n", count, expected->message );
+ return;
+ }
+
+ while (actual->message)
+ {
+ trace_(file, line)( " %u: expected: nothing - actual: %04x wp %08lx lp %08lx\n",
+ count, actual->message, actual->wParam, actual->lParam );
+ actual++;
+ count++;
+ }
+}
+
static void ok_sequence_(struct msg_sequence **seq, int sequence_index,
const struct message *expected, const char *context, BOOL todo,
const char *file, int line)
struct msg_sequence *msg_seq = seq[sequence_index];
static const struct message end_of_sequence = {0, 0, 0, 0};
const struct message *actual, *sequence;
- int failcount = 0;
+ int failcount = 0, dump = 0;
add_message(seq, sequence_index, &end_of_sequence);
while (expected->message && actual->message)
{
- trace_( file, line)("expected %04x - actual %04x\n", expected->message, actual->message);
-
if (expected->message == actual->message)
{
if (expected->flags & wparam)
todo_wine
{
failcount++;
+ dump++;
ok_(file, line) (FALSE,
"%s: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
context, expected->message, expected->wParam, actual->wParam);
ok_(file, line) (expected->wParam == actual->wParam,
"%s: in msg 0x%04x expecting wParam 0x%lx got 0x%lx\n",
context, expected->message, expected->wParam, actual->wParam);
+ if (expected->wParam != actual->wParam) dump++;
}
}
todo_wine
{
failcount++;
+ dump++;
ok_(file, line) (FALSE,
"%s: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
context, expected->message, expected->lParam, actual->lParam);
ok_(file, line) (expected->lParam == actual->lParam,
"%s: in msg 0x%04x expecting lParam 0x%lx got 0x%lx\n",
context, expected->message, expected->lParam, actual->lParam);
+ if (expected->lParam != actual->lParam) dump++;
+ }
+ }
+
+ if (expected->flags & custdraw)
+ {
+ if (expected->stage != actual->stage && todo)
+ {
+ todo_wine
+ {
+ failcount++;
+ dump++;
+ ok_(file, line) (FALSE,
+ "%s: in msg 0x%04x expecting cd stage 0x%08x got 0x%08x\n",
+ context, expected->message, expected->stage, actual->stage);
+ }
+ }
+ else
+ {
+ ok_(file, line) (expected->stage == actual->stage,
+ "%s: in msg 0x%04x expecting cd stage 0x%08x got 0x%08x\n",
+ context, expected->message, expected->stage, actual->stage);
+ if (expected->stage != actual->stage) dump++;
}
}
todo_wine
{
failcount++;
+ dump++;
ok_(file, line) (FALSE,
"%s: in msg 0x%04x expecting id 0x%x got 0x%x\n",
context, expected->message, expected->id, actual->id);
ok_(file, line) (expected->id == actual->id,
"%s: in msg 0x%04x expecting id 0x%x got 0x%x\n",
context, expected->message, expected->id, actual->id);
+ if (expected->id != actual->id) dump++;
}
}
todo_wine
{
failcount++;
+ dump++;
ok_(file, line) (FALSE,
"%s: the msg 0x%04x should %shave been sent by DefWindowProc\n",
context, expected->message, (expected->flags & defwinproc) ? "" : "NOT ");
ok_(file, line) ((expected->flags & defwinproc) == (actual->flags & defwinproc),
"%s: the msg 0x%04x should %shave been sent by DefWindowProc\n",
context, expected->message, (expected->flags & defwinproc) ? "" : "NOT ");
+ if ((expected->flags & defwinproc) != (actual->flags & defwinproc)) dump++;
}
ok_(file, line) ((expected->flags & beginpaint) == (actual->flags & beginpaint),
"%s: the msg 0x%04x should %shave been sent by BeginPaint\n",
context, expected->message, (expected->flags & beginpaint) ? "" : "NOT ");
+ if ((expected->flags & beginpaint) != (actual->flags & beginpaint)) dump++;
+
ok_(file, line) ((expected->flags & (sent|posted)) == (actual->flags & (sent|posted)),
"%s: the msg 0x%04x should have been %s\n",
context, expected->message, (expected->flags & posted) ? "posted" : "sent");
+ if ((expected->flags & (sent|posted)) != (actual->flags & (sent|posted))) dump++;
+
ok_(file, line) ((expected->flags & parent) == (actual->flags & parent),
"%s: the msg 0x%04x was expected in %s\n",
context, expected->message, (expected->flags & parent) ? "parent" : "child");
+ if ((expected->flags & parent) != (actual->flags & parent)) dump++;
+
ok_(file, line) ((expected->flags & hook) == (actual->flags & hook),
"%s: the msg 0x%04x should have been sent by a hook\n",
context, expected->message);
+ if ((expected->flags & hook) != (actual->flags & hook)) dump++;
+
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);
+ if ((expected->flags & winevent_hook) != (actual->flags & winevent_hook)) dump++;
+
expected++;
actual++;
}
else if (todo)
{
failcount++;
+ dump++;
todo_wine
{
ok_(file, line) (FALSE, "%s: the msg 0x%04x was expected, but got msg 0x%04x instead\n",
context, expected->message, actual->message);
}
-
- flush_sequence(seq, sequence_index);
- return;
+ goto done;
}
else
{
ok_(file, line) (FALSE, "%s: the msg 0x%04x was expected, but got msg 0x%04x instead\n",
context, expected->message, actual->message);
+ dump++;
expected++;
actual++;
}
if (expected->message || actual->message)
{
failcount++;
+ dump++;
ok_(file, line) (FALSE, "%s: the msg sequence is not complete: expected %04x - actual %04x\n",
context, expected->message, actual->message);
}
}
else if (expected->message || actual->message)
{
+ dump++;
ok_(file, line) (FALSE, "%s: the msg sequence is not complete: expected %04x - actual %04x\n",
context, expected->message, actual->message);
}
if(todo && !failcount) /* succeeded yet marked todo */
{
+ dump++;
todo_wine
{
ok_(file, line)(TRUE, "%s: marked \"todo_wine\" but succeeds\n", context);
}
}
+done:
+ if (dump) dump_sequence( seq, sequence_index, expected, context, file, line );
flush_sequence(seq, sequence_index);
}
message != WM_GETICON &&
message != WM_DEVICECHANGE)
{
- trace("parent: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
msg.message = message;
msg.flags = sent|wparam|lparam;
if (defwndproc_counter) msg.flags |= defwinproc;
LRESULT ret;
struct message msg;
- trace("syslink: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
msg.message = message;
msg.flags = sent|wparam|lparam;
if (defwndproc_counter) msg.flags |= defwinproc;
message != WM_GETICON &&
message != WM_DEVICECHANGE)
{
- trace("parent: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
msg.message = message;
msg.flags = sent|wparam|lparam;
if (defwndproc_counter) msg.flags |= defwinproc;
message != WM_GETICON &&
message != WM_DEVICECHANGE)
{
- trace("tab: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
msg.message = message;
msg.flags = sent|wparam|lparam;
if (defwndproc_counter) msg.flags |= defwinproc;
message != WM_GETICON &&
message != WM_DEVICECHANGE)
{
- trace("parent: %p, %04x, %08lx, %08lx\n", hWnd, message, wParam, lParam);
add_message(sequences, PARENT_SEQ_INDEX, &msg);
}
tiW.hwnd = NULL;
tiW.uId = 0x1234ABCD;
tiW.lParam = 0xaaaaaaaa;
+ tiW.lpszText = NULL;
r = SendMessageA(hwnd, TTM_GETTOOLINFOW, 0, (LPARAM)&tiW);
ok(r, "Getting tooltip info failed\n");
ok(0x1abe11ed == tiW.lParam ||
message != WM_GETICON &&
message != WM_DEVICECHANGE)
{
- trace("parent: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
msg.message = message;
msg.flags = sent|wparam|lparam;
if (defwndproc_counter) msg.flags |= defwinproc;
LRESULT ret;
struct message msg;
- trace("trackbar: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
msg.message = message;
msg.flags = sent|wparam|lparam;
if (defwndproc_counter) msg.flags |= defwinproc;
static BOOL g_disp_A_to_W;
static BOOL g_disp_set_stateimage;
static BOOL g_beginedit_alter_text;
+static HFONT g_customdraw_font;
-#define NUM_MSG_SEQUENCES 2
+#define NUM_MSG_SEQUENCES 3
#define TREEVIEW_SEQ_INDEX 0
#define PARENT_SEQ_INDEX 1
+#define PARENT_CD_SEQ_INDEX 2
#define expect(expected, got) ok(got == expected, "Expected %d, got %d\n", expected, got)
};
static const struct message parent_expand_kb_seq[] = {
- { WM_NOTIFY, sent|id|optional, 0, 0, TVN_KEYDOWN },
+ { WM_NOTIFY, sent|id, 0, 0, TVN_KEYDOWN },
{ WM_NOTIFY, sent|id, 0, 0, TVN_ITEMEXPANDINGA },
{ WM_NOTIFY, sent|id, 0, 0, TVN_ITEMEXPANDEDA },
{ WM_CHANGEUISTATE, sent|optional },
};
static const struct message parent_expand_empty_kb_seq[] = {
- { WM_NOTIFY, sent|id|optional, 0, 0, TVN_KEYDOWN },
+ { WM_NOTIFY, sent|id, 0, 0, TVN_KEYDOWN },
{ WM_CHANGEUISTATE, sent|optional },
{ 0 }
};
{ 0 }
};
+static const struct message parent_cd_seq[] = {
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_PREPAINT },
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPREPAINT },
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_ITEMPOSTPAINT },
+ { WM_NOTIFY, sent|id|custdraw, 0, 0, NM_CUSTOMDRAW, CDDS_POSTPAINT },
+ { 0 }
+};
+
+static const struct message parent_vk_return_seq[] = {
+ { WM_NOTIFY, sent|id, 0, 0, TVN_KEYDOWN },
+ { WM_NOTIFY, sent|id, 0, 0, NM_RETURN },
+ { WM_CHANGEUISTATE, sent|optional },
+ { 0 }
+};
+
static HWND hMainWnd;
static HTREEITEM hRoot, hChild;
message != WM_GETICON &&
message != WM_DEVICECHANGE)
{
- trace("parent: %p, %04x, %08lx, %08lx\n", hWnd, message, wParam, lParam);
add_message(sequences, PARENT_SEQ_INDEX, &msg);
}
break;
}
+ case NM_CUSTOMDRAW:
+ {
+ NMTVCUSTOMDRAW *nmcd = (NMTVCUSTOMDRAW*)lParam;
+ COLORREF c0ffee = RGB(0xc0,0xff,0xee), cafe = RGB(0xca,0xfe,0x00);
+
+ msg.flags |= custdraw;
+ msg.stage = nmcd->nmcd.dwDrawStage;
+ add_message(sequences, PARENT_CD_SEQ_INDEX, &msg);
+
+ switch (msg.stage)
+ {
+ case CDDS_PREPAINT:
+ return CDRF_NOTIFYITEMDRAW|CDRF_NOTIFYITEMERASE|CDRF_NOTIFYPOSTPAINT;
+ case CDDS_ITEMPREPAINT:
+ nmcd->clrTextBk = c0ffee;
+ nmcd->clrText = cafe;
+ if (g_customdraw_font)
+ SelectObject(nmcd->nmcd.hdc, g_customdraw_font);
+ return CDRF_NOTIFYPOSTPAINT|CDRF_NEWFONT;
+ case CDDS_ITEMPOSTPAINT:
+ /* at the point of post paint notification colors are already restored */
+ ok(GetTextColor(nmcd->nmcd.hdc) != cafe, "got 0%x\n", GetTextColor(nmcd->nmcd.hdc));
+ ok(GetBkColor(nmcd->nmcd.hdc) != c0ffee, "got 0%x\n", GetBkColor(nmcd->nmcd.hdc));
+ if (g_customdraw_font)
+ ok(GetCurrentObject(nmcd->nmcd.hdc, OBJ_FONT) != g_customdraw_font, "got %p\n",
+ GetCurrentObject(nmcd->nmcd.hdc, OBJ_FONT));
+ break;
+ default:
+ ;
+ }
+ break;
+ }
}
}
break;
DestroyWindow(hTree);
}
+static void test_customdraw(void)
+{
+ static const char *rootA = "root";
+ TVINSERTSTRUCTA ins;
+ HTREEITEM hRoot;
+ LOGFONTA lf;
+ HWND hwnd;
+
+ hwnd = create_treeview_control(0);
+
+ ins.hParent = TVI_ROOT;
+ ins.hInsertAfter = TVI_ROOT;
+ U(ins).item.mask = TVIF_TEXT;
+ U(ins).item.pszText = (char*)rootA;
+ hRoot = TreeView_InsertItemA(hwnd, &ins);
+ ok(hRoot != NULL, "got %p\n", hRoot);
+
+ /* create additional font, custom draw handler will select it */
+ SystemParametersInfoA(SPI_GETICONTITLELOGFONT, sizeof(lf), &lf, 0);
+ lf.lfHeight *= 2;
+ g_customdraw_font = CreateFontIndirectA(&lf);
+ flush_sequences(sequences, NUM_MSG_SEQUENCES);
+ InvalidateRect(hwnd, NULL, TRUE);
+ UpdateWindow(hwnd);
+ ok_sequence(sequences, PARENT_CD_SEQ_INDEX, parent_cd_seq, "custom draw notifications", FALSE);
+ DeleteObject(g_customdraw_font);
+ g_customdraw_font = NULL;
+
+ DestroyWindow(hwnd);
+}
+
+static void test_WM_KEYDOWN(void)
+{
+ static const char *rootA = "root";
+ TVINSERTSTRUCTA ins;
+ HTREEITEM hRoot;
+ HWND hwnd;
+
+ hwnd = create_treeview_control(0);
+
+ ins.hParent = TVI_ROOT;
+ ins.hInsertAfter = TVI_ROOT;
+ U(ins).item.mask = TVIF_TEXT;
+ U(ins).item.pszText = (char*)rootA;
+ hRoot = TreeView_InsertItemA(hwnd, &ins);
+ ok(hRoot != NULL, "got %p\n", hRoot);
+
+ flush_sequences(sequences, NUM_MSG_SEQUENCES);
+ SendMessageA(hwnd, WM_KEYDOWN, VK_RETURN, 0);
+ ok_sequence(sequences, PARENT_SEQ_INDEX, parent_vk_return_seq, "WM_KEYDOWN/VK_RETURN parent notification", TRUE);
+
+ DestroyWindow(hwnd);
+}
+
START_TEST(treeview)
{
HMODULE hComctl32;
test_TVM_GETNEXTITEM();
test_TVM_HITTEST();
test_WM_GETDLGCODE();
+ test_customdraw();
+ test_WM_KEYDOWN();
if (!load_v6_module(&ctx_cookie, &hCtx))
{
message != WM_GETICON &&
message != WM_DEVICECHANGE)
{
- trace("parent: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
msg.message = message;
msg.flags = sent|wparam|lparam;
if (defwndproc_counter) msg.flags |= defwinproc;
LRESULT ret;
struct message msg;
- trace("edit: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
msg.message = message;
msg.flags = sent|wparam|lparam;
if (defwndproc_counter) msg.flags |= defwinproc;
LRESULT ret;
struct message msg;
- trace("updown: %p, %04x, %08lx, %08lx\n", hwnd, message, wParam, lParam);
-
msg.message = message;
msg.flags = sent|wparam|lparam;
if (defwndproc_counter) msg.flags |= defwinproc;