From 5ec441a867dee5ffde551d40f71961baf7f671fd Mon Sep 17 00:00:00 2001 From: David Quintana Date: Tue, 23 Jan 2018 23:10:44 +0100 Subject: [PATCH] [EXPLORER] Workaround for something that may or may not be an "unintended feature" of the comctl toolbar. Apparently the indices provided in NMTBGETINFOTIP (TBN_GETINFOTIP data struct), are not reliable, but since the lParam values are, and it saves us a lookup, we will be using those instead. Win-Win! --- base/shell/explorer/trayntfy.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/base/shell/explorer/trayntfy.cpp b/base/shell/explorer/trayntfy.cpp index f61e1f6bb4b..1b05b501a70 100644 --- a/base/shell/explorer/trayntfy.cpp +++ b/base/shell/explorer/trayntfy.cpp @@ -853,14 +853,17 @@ public: } - VOID GetTooltipText(int index, LPTSTR szTip, DWORD cchTip) + VOID GetTooltipText(LPARAM data, LPTSTR szTip, DWORD cchTip) { - InternalIconData * notifyItem = GetItemData(index); - + InternalIconData * notifyItem = reinterpret_cast(data); if (notifyItem) { StringCchCopy(szTip, cchTip, notifyItem->szTip); } + else + { + StringCchCopy(szTip, cchTip, L""); + } } VOID ResizeImagelist() @@ -1240,7 +1243,7 @@ public: LRESULT OnGetInfoTip(INT uCode, LPNMHDR hdr, BOOL& bHandled) { NMTBGETINFOTIPW * nmtip = (NMTBGETINFOTIPW *) hdr; - Toolbar.GetTooltipText(nmtip->iItem, nmtip->pszText, nmtip->cchTextMax); + Toolbar.GetTooltipText(nmtip->lParam, nmtip->pszText, nmtip->cchTextMax); return TRUE; }