[BROWSEUI] Show Tooltip text for 'Go' Button 786/head
authorRobert Naumann <gonzomdx@gmail.com>
Tue, 21 Aug 2018 08:05:50 +0000 (10:05 +0200)
committerMark Jansen <mark.jansen@reactos.org>
Tue, 21 Aug 2018 10:49:04 +0000 (12:49 +0200)
-Patch by Barret Karish CORE-11058

dll/win32/browseui/addressband.cpp
dll/win32/browseui/addressband.h

index 0bc3e97..54b0480 100644 (file)
@@ -415,8 +415,17 @@ LRESULT CAddressBand::OnTipText(UINT idControl, NMHDR *notifyHeader, BOOL &bHand
 {
     if (notifyHeader->hwndFrom == fGoButton)
     {
-        // TODO
-        // Go to "destination path"
+        WCHAR szText[MAX_PATH];
+        WCHAR szFormat[MAX_PATH];
+        LPNMTBGETINFOTIP pGIT = (LPNMTBGETINFOTIP)notifyHeader;
+
+        if (::GetWindowTextW(fEditControl, szText, _countof(szText)))
+        {
+            LoadStringW(_AtlBaseModule.GetResourceInstance(), IDS_GOBUTTONTIPTEMPLATE, szFormat, _countof(szFormat));
+            wnsprintf(pGIT->pszText, pGIT->cchTextMax, szFormat, szText);
+        }
+        else
+            *pGIT->pszText = 0;
     }
     return 0;
 }
index eaba142..c4fd006 100644 (file)
@@ -109,7 +109,7 @@ public:
 
     BEGIN_MSG_MAP(CAddressBand)
         NOTIFY_CODE_HANDLER(NM_CLICK, OnNotifyClick)
-        NOTIFY_CODE_HANDLER(TTN_NEEDTEXTW, OnTipText)
+        NOTIFY_CODE_HANDLER(TBN_GETINFOTIP, OnTipText)
         MESSAGE_HANDLER(WM_ERASEBKGND, OnEraseBackground)
         MESSAGE_HANDLER(WM_SIZE, OnSize)
         MESSAGE_HANDLER(WM_WINDOWPOSCHANGING, OnWindowPosChanging)