diff --git a/reactos/base/shell/explorer/taskswnd.cpp b/reactos/base/shell/explorer/taskswnd.cpp index d56c2f993cf..83413210e77 100644 --- a/reactos/base/shell/explorer/taskswnd.cpp +++ b/reactos/base/shell/explorer/taskswnd.cpp @@ -378,11 +378,11 @@ public: SendMessageTimeout(hwnd, WM_GETICON, ICON_BIG, 0, SMTO_ABORTIFHUNG, 1000, (PDWORD_PTR) &hIcon); if (hIcon) return hIcon; - + hIcon = (HICON) GetClassLongPtr(hwnd, GCL_HICONSM); if (hIcon) return hIcon; - + hIcon = (HICON) GetClassLongPtr(hwnd, GCL_HICON); return hIcon; @@ -1279,7 +1279,7 @@ public: } LRESULT OnThemeChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) - { + { return OnThemeChanged(); } @@ -1353,7 +1353,7 @@ public: return Ret; } - + LRESULT HandleShellHookMsg(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { BOOL Ret = FALSE; @@ -1526,7 +1526,7 @@ public: HMENU hmenu = GetSystemMenu(TaskItem->hWnd, FALSE); - if (hmenu) + if (hmenu) { POINT pt; int cmd; @@ -1756,11 +1756,12 @@ public: LRESULT OnContextMenu(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled) { - LRESULT Ret; + LRESULT Ret = 0; + INT_PTR iBtn = -1; + if (m_TaskBar.m_hWnd != NULL) { POINT pt; - INT_PTR iBtn; pt.x = GET_X_LPARAM(lParam); pt.y = GET_Y_LPARAM(lParam); @@ -1772,13 +1773,10 @@ public: { HandleButtonRightClick(iBtn); } - else - goto ForwardContextMenuMsg; } - else + if (iBtn < 0) { - ForwardContextMenuMsg: - /* Forward message */ + /* Not on a taskbar button, so forward message to tray */ Ret = SendMessage(m_Tray->GetHWND(), uMsg, wParam, lParam); } return Ret;