diff --git a/base/shell/explorer/appbar.cpp b/base/shell/explorer/appbar.cpp index f3a3e880692..3f980ec589f 100644 --- a/base/shell/explorer/appbar.cpp +++ b/base/shell/explorer/appbar.cpp @@ -75,17 +75,26 @@ static struct appbar_data* get_appbar(HWND hwnd) return NULL; } +void appbar_notify_all(HMONITOR hMon, UINT uMsg, HWND hwndExclude, LPARAM lParam) +{ + struct appbar_data* data; + + LIST_FOR_EACH_ENTRY(data, &appbars, struct appbar_data, entry) + { + if (data->hwnd == hwndExclude) + continue; + + if (hMon && hMon != MonitorFromWindow(data->hwnd, MONITOR_DEFAULTTONULL)) + continue; + + SendMessageW(data->hwnd, data->callback_msg, uMsg, lParam); + } +} + /* send_poschanged: send ABN_POSCHANGED to every appbar except one */ static void send_poschanged(HWND hwnd) { - struct appbar_data* data; - LIST_FOR_EACH_ENTRY(data, &appbars, struct appbar_data, entry) - { - if (data->hwnd != hwnd) - { - PostMessageW(data->hwnd, data->callback_msg, ABN_POSCHANGED, 0); - } - } + appbar_notify_all(NULL, ABN_POSCHANGED, hwnd, 0); } /* appbar_cliprect: cut out parts of the rectangle that interfere with existing appbars */ diff --git a/base/shell/explorer/traywnd.cpp b/base/shell/explorer/traywnd.cpp index 2e081329d19..8dd491b0678 100644 --- a/base/shell/explorer/traywnd.cpp +++ b/base/shell/explorer/traywnd.cpp @@ -24,6 +24,7 @@ HRESULT TrayWindowCtxMenuCreator(ITrayWindow * TrayWnd, IN HWND hWndOwner, IContextMenu ** ppCtxMenu); LRESULT appbar_message(COPYDATASTRUCT* cds); +void appbar_notify_all(HMONITOR hMon, UINT uMsg, HWND hwndExclude, LPARAM lParam); #define WM_APP_TRAYDESTROY (WM_APP + 0x100) @@ -608,15 +609,21 @@ public: break; case ID_SHELL_CMD_TILE_WND_H: + appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, TRUE); TileWindows(NULL, MDITILE_HORIZONTAL, NULL, 0, NULL); + appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, FALSE); break; case ID_SHELL_CMD_TILE_WND_V: + appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, TRUE); TileWindows(NULL, MDITILE_VERTICAL, NULL, 0, NULL); + appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, FALSE); break; case ID_SHELL_CMD_CASCADE_WND: + appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, TRUE); CascadeWindows(NULL, MDITILE_SKIPDISABLED, NULL, 0, NULL); + appbar_notify_all(NULL, ABN_WINDOWARRANGE, NULL, FALSE); break; case ID_SHELL_CMD_CUST_NOTIF: