https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1c400705618b64475afb71fd70b1abce8a5effa4

commit 1c400705618b64475afb71fd70b1abce8a5effa4
Author:     Katayama Hirofumi MZ <[email protected]>
AuthorDate: Mon Aug 10 07:15:21 2020 +0900
Commit:     GitHub <[email protected]>
CommitDate: Mon Aug 10 07:15:21 2020 +0900

    [EXPLORER] Improve CTrayWindow::OnCopyData (#3028)
    
    Check pCopyData->dwData value. Don't send message needlessly.
    CORE-7237
---
 base/shell/explorer/syspager.cpp |  7 -------
 base/shell/explorer/traywnd.cpp  | 15 +++++++++++----
 2 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/base/shell/explorer/syspager.cpp b/base/shell/explorer/syspager.cpp
index 8d507c5be60..7e61b00a042 100644
--- a/base/shell/explorer/syspager.cpp
+++ b/base/shell/explorer/syspager.cpp
@@ -1531,8 +1531,6 @@ LRESULT CSysPagerWnd::OnTimer(UINT uMsg, WPARAM wParam, 
LPARAM lParam, BOOL& bHa
     return 0;
 }
 
-LRESULT appbar_message( COPYDATASTRUCT* cds );
-
 LRESULT CSysPagerWnd::OnCopyData(UINT uMsg, WPARAM wParam, LPARAM lParam, 
BOOL& bHandled)
 {
     PCOPYDATASTRUCT cpData = (PCOPYDATASTRUCT)lParam;
@@ -1543,11 +1541,6 @@ LRESULT CSysPagerWnd::OnCopyData(UINT uMsg, WPARAM 
wParam, LPARAM lParam, BOOL&
         if (pData->dwSignature == NI_NOTIFY_SIG)
             return NotifyIcon(pData->dwMessage, &pData->nid);
     }
-    else if (cpData->dwData == TABDMC_APPBAR)
-    {
-        FIXME("Taskbar Tray Application Bar\n");
-        return appbar_message( cpData );
-    }
     else if (cpData->dwData == TABDMC_LOADINPROC)
     {
         FIXME("Taskbar Load In Proc\n");
diff --git a/base/shell/explorer/traywnd.cpp b/base/shell/explorer/traywnd.cpp
index b27a4689fee..2e081329d19 100644
--- a/base/shell/explorer/traywnd.cpp
+++ b/base/shell/explorer/traywnd.cpp
@@ -23,6 +23,7 @@
 #include <commoncontrols.h>
 
 HRESULT TrayWindowCtxMenuCreator(ITrayWindow * TrayWnd, IN HWND hWndOwner, 
IContextMenu ** ppCtxMenu);
+LRESULT appbar_message(COPYDATASTRUCT* cds);
 
 #define WM_APP_TRAYDESTROY  (WM_APP + 0x100)
 
@@ -2197,7 +2198,6 @@ ChangePos:
         return m_ContextMenu->GetCommandString(idCmd, uType, pwReserved, 
pszName, cchMax);
     }
 
-
     /**********************************************************
      *    ##### message handling #####
      */
@@ -2341,9 +2341,16 @@ ChangePos:
 
     LRESULT OnCopyData(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
     {
-        if (m_TrayNotify)
-            ::SendMessageW(m_TrayNotify, uMsg, wParam, lParam);
-        return TRUE;
+        COPYDATASTRUCT *pCopyData = reinterpret_cast<COPYDATASTRUCT *>(lParam);
+        switch (pCopyData->dwData)
+        {
+            case TABDMC_APPBAR:
+                return appbar_message(pCopyData);
+            case TABDMC_NOTIFY:
+            case TABDMC_LOADINPROC:
+                return ::SendMessageW(m_TrayNotify, uMsg, wParam, lParam);
+        }
+        return FALSE;
     }
 
     LRESULT OnNcPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)

Reply via email to