From 8adae9aa1f7034e905cd87b4942626311ec363a5 Mon Sep 17 00:00:00 2001 From: Vincent Povirk Date: Tue, 2 Sep 2008 15:36:21 -0500 Subject: [PATCH] explorer: Track appbar positions and send ABN_POSCHANGED notifications. --- programs/explorer/appbar.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/programs/explorer/appbar.c b/programs/explorer/appbar.c index 02e3acd5f77..b67a60eb982 100644 --- a/programs/explorer/appbar.c +++ b/programs/explorer/appbar.c @@ -48,6 +48,10 @@ struct appbar_data struct list entry; HWND hwnd; UINT callback_msg; + UINT edge; + RECT rc; + BOOL space_reserved; + /* BOOL autohide; */ }; static struct list appbars = LIST_INIT(appbars); @@ -65,6 +69,19 @@ static struct appbar_data* get_appbar(HWND hwnd) return NULL; } +/* 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); + } + } +} + static UINT_PTR handle_appbarmessage(DWORD msg, PAPPBARDATA abd) { struct appbar_data* data; @@ -95,6 +112,8 @@ static UINT_PTR handle_appbarmessage(DWORD msg, PAPPBARDATA abd) { list_remove(&data->entry); + send_poschanged(abd->hWnd); + HeapFree(GetProcessHeap(), 0, data); } else @@ -105,6 +124,24 @@ static UINT_PTR handle_appbarmessage(DWORD msg, PAPPBARDATA abd) return TRUE; case ABM_SETPOS: WINE_FIXME("SHAppBarMessage(ABM_SETPOS, hwnd=%p, edge=%x, rc=%s): stub\n", abd->hWnd, abd->uEdge, wine_dbgstr_rect(&abd->rc)); + if (abd->uEdge > ABE_BOTTOM) + { + WINE_WARN("invalid edge %i for %p\n", abd->uEdge, abd->hWnd); + return TRUE; + } + if ((data = get_appbar(abd->hWnd))) + { + if (!EqualRect(&abd->rc, &data->rc)) + send_poschanged(abd->hWnd); + + data->edge = abd->uEdge; + data->rc = abd->rc; + data->space_reserved = TRUE; + } + else + { + WINE_WARN("app sent ABM_SETPOS message for %p without ABM_ADD\n", abd->hWnd); + } return TRUE; case ABM_GETSTATE: WINE_FIXME("SHAppBarMessage(ABM_GETSTATE): stub\n"); -- 2.11.4.GIT