explorer: Track appbar positions and send ABN_POSCHANGED notifications.

This commit is contained in:
Vincent Povirk 2008-09-02 15:36:21 -05:00 committed by Alexandre Julliard
parent 96f8de0de9
commit 8adae9aa1f
1 changed files with 37 additions and 0 deletions

View File

@ -48,6 +48,10 @@ struct appbar_data
struct list entry; struct list entry;
HWND hwnd; HWND hwnd;
UINT callback_msg; UINT callback_msg;
UINT edge;
RECT rc;
BOOL space_reserved;
/* BOOL autohide; */
}; };
static struct list appbars = LIST_INIT(appbars); static struct list appbars = LIST_INIT(appbars);
@ -65,6 +69,19 @@ static struct appbar_data* get_appbar(HWND hwnd)
return NULL; 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) static UINT_PTR handle_appbarmessage(DWORD msg, PAPPBARDATA abd)
{ {
struct appbar_data* data; struct appbar_data* data;
@ -95,6 +112,8 @@ static UINT_PTR handle_appbarmessage(DWORD msg, PAPPBARDATA abd)
{ {
list_remove(&data->entry); list_remove(&data->entry);
send_poschanged(abd->hWnd);
HeapFree(GetProcessHeap(), 0, data); HeapFree(GetProcessHeap(), 0, data);
} }
else else
@ -105,6 +124,24 @@ static UINT_PTR handle_appbarmessage(DWORD msg, PAPPBARDATA abd)
return TRUE; return TRUE;
case ABM_SETPOS: 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)); 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; return TRUE;
case ABM_GETSTATE: case ABM_GETSTATE:
WINE_FIXME("SHAppBarMessage(ABM_GETSTATE): stub\n"); WINE_FIXME("SHAppBarMessage(ABM_GETSTATE): stub\n");