From e99e22229d7f037fce783d59e4f7fa3a1bc8153a Mon Sep 17 00:00:00 2001 From: David Quintana Date: Tue, 19 May 2015 20:31:31 +0000 Subject: [PATCH] [STOBJECT] Followup to r67830: When no one handles a message, properly return that it was not handled. This way all messages are handled correctly and not just NCCREATE. Also took the chance to short-cut NCDESTROY, since the icon handlers have no need to receive this message. CORE-9592 #resolve svn path=/trunk/; revision=67831 --- reactos/dll/shellext/stobject/csystray.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/reactos/dll/shellext/stobject/csystray.cpp b/reactos/dll/shellext/stobject/csystray.cpp index c6ed961b5fc..6ae1eafb9e6 100644 --- a/reactos/dll/shellext/stobject/csystray.cpp +++ b/reactos/dll/shellext/stobject/csystray.cpp @@ -87,11 +87,12 @@ HRESULT CSysTray::ProcessIconMessage(UINT uMsg, WPARAM wParam, LPARAM lParam) if (FAILED(hr)) return hr; - if (hr != S_FALSE) + if (hr == S_OK) return hr; } - return S_OK; + // Not handled by anyone, so return accordingly. + return S_FALSE; } HRESULT CSysTray::NotifyIcon(INT code, UINT uId, HICON hIcon, LPCWSTR szTip) @@ -207,6 +208,7 @@ BOOL CSysTray::ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM switch (uMsg) { case WM_NCCREATE: + case WM_NCDESTROY: return FALSE; case WM_CREATE: InitIcons(); @@ -227,8 +229,5 @@ BOOL CSysTray::ProcessWindowMessage(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM if (FAILED(hr)) return FALSE; - if (hr == S_FALSE) - return FALSE; - - return TRUE; + return (hr == S_OK); }