comctl32: treeview[2/3]: treeviews shouldn't be sending
NM_TOOLTIPSCREATED (with testcase, fixes bug #5491)
Mikołaj Zalewski
mikolaj at zalewski.pl
Sat May 5 13:22:30 CDT 2007
This makes the GetSetToolTips message sequence a todo but till now it
didn't test anything useful, so I hope this is not a problem.
-------------- next part --------------
From 470ff9fb5c86a637191d7ce4aab4721503b87321 Mon Sep 17 00:00:00 2001
From: =?utf-8?q?Miko=C5=82aj_Zalewski?= <mikolaj at zalewski.pl>
Date: Sat, 5 May 2007 20:04:00 +0200
Subject: [PATCH] comctl32: treeview: treeviews shouldn't be sending NM_TOOLTIPSCREATED (with testcase, fixes bug #5491)
---
dlls/comctl32/tests/treeview.c | 10 +++++++++-
dlls/comctl32/treeview.c | 4 +++-
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/dlls/comctl32/tests/treeview.c b/dlls/comctl32/tests/treeview.c
index 6f94fa7..3b99c4f 100644
--- a/dlls/comctl32/tests/treeview.c
+++ b/dlls/comctl32/tests/treeview.c
@@ -169,6 +169,8 @@ static const struct message TestGetSetTextColorSeq[] = {
};
static const struct message TestGetSetToolTipsSeq[] = {
+ { WM_COMMAND, sent|wparam, 0x02000000 },
+ { WM_PARENTNOTIFY, sent|wparam|defwinproc, 0x00020002 },
{ TVM_SETTOOLTIPS, sent|wparam|lparam, 0x00000000, 0x00000000 },
{ TVM_GETTOOLTIPS, sent|wparam|lparam, 0x00000000, 0x00000000 },
{ 0 }
@@ -470,6 +472,11 @@ static void TestGetSetTextColor(void)
static void TestGetSetToolTips(void)
{
HWND hwndLastToolTip = NULL;
+ HWND hPopupTreeView;
+
+ /* show even WS_POPUP treeview don't send NM_TOOLTIPSCREATED */
+ hPopupTreeView = CreateWindow(WC_TREEVIEW, NULL, WS_POPUP|WS_VISIBLE, 0, 0, 100, 100, hMainWnd, NULL, NULL, NULL);
+ DestroyWindow(hPopupTreeView);
/* Testing setting a NULL ToolTip */
SendMessage( hTree, TVM_SETTOOLTIPS, 0, 0 );
@@ -552,7 +559,7 @@ static void TestGetSet(void)
flush_sequences(MsgSequences, NUM_MSG_SEQUENCES);
TestGetSetToolTips();
ok_sequence(MsgSequences, LISTVIEW_SEQ_INDEX, TestGetSetToolTipsSeq,
- "TestGetSetToolTips", FALSE);
+ "TestGetSetToolTips", TRUE);
/* TVM_GETUNICODEFORMAT and TVM_SETUNICODEFORMAT */
flush_sequences(MsgSequences, NUM_MSG_SEQUENCES);
@@ -614,6 +621,7 @@ static LRESULT CALLBACK MyWndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
{
NMHDR *pHdr = (NMHDR *)lParam;
+ ok(pHdr->code != NM_FIRST - 19, "Treeview should not send NM_TOOLTIPSCREATED\n");
if (pHdr->idFrom == 100) {
NMTREEVIEWA *pTreeView = (LPNMTREEVIEWA) lParam;
switch(pHdr->code) {
diff --git a/dlls/comctl32/treeview.c b/dlls/comctl32/treeview.c
index 8adf28b..40c053d 100644
--- a/dlls/comctl32/treeview.c
+++ b/dlls/comctl32/treeview.c
@@ -4967,7 +4967,9 @@ TREEVIEW_Create(HWND hwnd, const CREATESTRUCTW *lpcs)
TREEVIEW_NotifyFormat(infoPtr, infoPtr->hwndNotify, NF_REQUERY);
if (!(infoPtr->dwStyle & TVS_NOTOOLTIPS))
- infoPtr->hwndToolTip = COMCTL32_CreateToolTip(hwnd);
+ infoPtr->hwndToolTip = CreateWindowExW(0, TOOLTIPS_CLASSW, NULL, WS_POPUP,
+ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
+ hwnd, 0, 0, 0);
if (infoPtr->dwStyle & TVS_CHECKBOXES)
initialize_checkboxes(infoPtr);
--
1.4.4.2
More information about the wine-patches
mailing list