Mikołaj Zalewski : comctl32: treeview: Treeviews shouldn't be sending NM_TOOLTIPSCREATED (with testcase).
Alexandre Julliard
julliard at wine.codeweavers.com
Mon May 7 09:10:27 CDT 2007
Module: wine
Branch: master
Commit: 81cf09c6da5d0406c37a7711fd378e062e42d984
URL: http://source.winehq.org/git/wine.git/?a=commit;h=81cf09c6da5d0406c37a7711fd378e062e42d984
Author: Mikołaj Zalewski <mikolaj at zalewski.pl>
Date: Sat May 5 20:22:30 2007 +0200
comctl32: treeview: Treeviews shouldn't be sending NM_TOOLTIPSCREATED (with testcase).
---
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..3b33eab 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);
More information about the wine-cvs
mailing list