diff --git a/reactos/base/shell/explorer/precomp.h b/reactos/base/shell/explorer/precomp.h index 166673589c0..07749ac082b 100644 --- a/reactos/base/shell/explorer/precomp.h +++ b/reactos/base/shell/explorer/precomp.h @@ -337,7 +337,7 @@ UnregisterTrayNotifyWndClass(VOID); HWND CreateTrayNotifyWnd(IN OUT ITrayWindow *TrayWindow, IN BOOL bHideClock, CTrayNotifyWnd** ppTrayNotify); -VOID +BOOL TrayNotify_NotifyMsg(CTrayNotifyWnd* pTrayNotify, IN WPARAM wParam, IN LPARAM lParam); diff --git a/reactos/base/shell/explorer/trayntfy.cpp b/reactos/base/shell/explorer/trayntfy.cpp index adc5ae05361..dc42992f44d 100644 --- a/reactos/base/shell/explorer/trayntfy.cpp +++ b/reactos/base/shell/explorer/trayntfy.cpp @@ -82,7 +82,7 @@ public: return -1; } - VOID AddButton(IN CONST NOTIFYICONDATA *iconData) + BOOL AddButton(IN CONST NOTIFYICONDATA *iconData) { TBBUTTON tbBtn; NOTIFYICONDATA * notifyItem; @@ -91,8 +91,7 @@ public: int index = FindItemByIconData(iconData, ¬ifyItem); if (index >= 0) { - UpdateButton(iconData); - return; + return UpdateButton(iconData); } notifyItem = new NOTIFYICONDATA(); @@ -138,9 +137,11 @@ public: CToolbar::AddButton(&tbBtn); SetButtonSize(ICON_SIZE, ICON_SIZE); + + return TRUE; } - VOID UpdateButton(IN CONST NOTIFYICONDATA *iconData) + BOOL UpdateButton(IN CONST NOTIFYICONDATA *iconData) { NOTIFYICONDATA * notifyItem; TBBUTTONINFO tbbi = { 0 }; @@ -148,8 +149,7 @@ public: int index = FindItemByIconData(iconData, ¬ifyItem); if (index < 0) { - AddButton(iconData); - return; + return AddButton(iconData); } tbbi.cbSize = sizeof(tbbi); @@ -197,15 +197,17 @@ public: /* TODO: support NIF_INFO, NIF_GUID, NIF_REALTIME, NIF_SHOWTIP */ SetButtonInfo(index, &tbbi); + + return TRUE; } - VOID RemoveButton(IN CONST NOTIFYICONDATA *iconData) + BOOL RemoveButton(IN CONST NOTIFYICONDATA *iconData) { NOTIFYICONDATA * notifyItem; int index = FindItemByIconData(iconData, ¬ifyItem); if (index < 0) - return; + return FALSE; DeleteButton(index); @@ -215,6 +217,8 @@ public: } delete notifyItem; + + return TRUE; } VOID GetTooltipText(int index, LPTSTR szTip, DWORD cchTip) @@ -432,20 +436,11 @@ public: switch (data->notify_code) { case NIM_ADD: - { - Toolbar.AddButton(iconData); - break; - } + return Toolbar.AddButton(iconData); case NIM_MODIFY: - { - Toolbar.UpdateButton(iconData); - break; - } + return Toolbar.UpdateButton(iconData); case NIM_DELETE: - { - Toolbar.RemoveButton(iconData); - break; - } + return Toolbar.RemoveButton(iconData); default: TRACE("NotifyMessage received with unknown code %d.\n", data->notify_code); break; @@ -1458,7 +1453,7 @@ public: { if (m_pager) { - m_pager->NotifyMsg(uMsg, wParam, lParam, bHandled); + return m_pager->NotifyMsg(uMsg, wParam, lParam, bHandled); } return TRUE; @@ -1589,11 +1584,11 @@ HWND CreateTrayNotifyWnd(IN OUT ITrayWindow *Tray, BOOL bHideClock, CTrayNotifyW return pTrayNotify->_Init(Tray, bHideClock); } -VOID +BOOL TrayNotify_NotifyMsg(CTrayNotifyWnd* pTrayNotify, WPARAM wParam, LPARAM lParam) { BOOL bDummy; - pTrayNotify->NotifyMsg(0, wParam, lParam, bDummy); + return pTrayNotify->NotifyMsg(0, wParam, lParam, bDummy); } BOOL diff --git a/reactos/base/shell/explorer/traywnd.cpp b/reactos/base/shell/explorer/traywnd.cpp index 32df7c55c5b..2bd46aefbb9 100644 --- a/reactos/base/shell/explorer/traywnd.cpp +++ b/reactos/base/shell/explorer/traywnd.cpp @@ -2184,7 +2184,7 @@ ChangePos: { if (m_TrayNotify) { - TrayNotify_NotifyMsg(m_TrayNotifyInstance, wParam, lParam); + return TrayNotify_NotifyMsg(m_TrayNotifyInstance, wParam, lParam); } return TRUE; }