add_library(shell32 SHARED
${SOURCE}
+ wine/appbar.c
wine/brsfolder.c
wine/changenotify.c
wine/classes.c
}
/* Send the data */
- data.dwData = 1;
+ data.dwData = TABDMC_NOTIFY;
data.cbData = sizeof(tnid);
data.lpData = &tnid;
if (SendMessageW(hShellTrayWnd, WM_COPYDATA, (WPARAM)pnid->hWnd, (LPARAM)&data))
--- /dev/null
+/*
+ * SHAppBarMessage implementation
+ *
+ * Copyright 2008 Vincent Povirk for CodeWeavers
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ */
+
+//
+// Adapted from Wine appbar.c .
+//
+
+#include <wine/config.h>
+
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <stdio.h>
+
+#include <windef.h>
+#include <winbase.h>
+#include <winerror.h>
+#include <shellapi.h>
+#include <winuser.h>
+#include <shlobj.h>
+#include <shlwapi.h>
+
+#include "undocshell.h"
+
+#include <wine/debug.h>
+#include <wine/unicode.h>
+
+WINE_DEFAULT_DEBUG_CHANNEL(appbar);
+
+struct appbar_cmd
+{
+ DWORD dwMsg;
+ ULONG return_map;
+ DWORD return_process;
+ struct _AppBarData abd;
+};
+
+struct appbar_response
+{
+ ULONGLONG result;
+ struct _AppBarData abd;
+};
+
+/*************************************************************************
+ * SHAppBarMessage [SHELL32.@]
+ */
+UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
+{
+ struct appbar_cmd command;
+ struct appbar_response* response;
+ HANDLE return_map;
+ LPVOID return_view;
+ HWND appbarmsg_window;
+ COPYDATASTRUCT cds;
+
+ UINT_PTR ret = 0;
+
+ TRACE("msg=%d, data={cb=%d, hwnd=%p}\n", msg, data->cbSize, data->hWnd);
+
+ /* These members are message dependent */
+ switch(msg)
+ {
+ case ABM_NEW:
+ TRACE("callback: %x\n", data->uCallbackMessage);
+ break;
+
+ case ABM_GETAUTOHIDEBAR:
+ TRACE("edge: %d\n", data->uEdge);
+ break;
+
+ case ABM_QUERYPOS:
+ case ABM_SETPOS:
+ TRACE("edge: %d, rc: %s\n", data->uEdge, wine_dbgstr_rect(&data->rc));
+ break;
+
+ case ABM_GETTASKBARPOS:
+ TRACE("rc: %s\n", wine_dbgstr_rect(&data->rc));
+ break;
+
+ case ABM_SETAUTOHIDEBAR:
+ TRACE("edge: %d, lParam: %lx\n", data->uEdge, data->lParam);
+ break;
+
+ default:
+ FIXME("unknown msg: %d\n", msg);
+ break;
+ }
+
+ if (data->cbSize < sizeof(APPBARDATA))
+ {
+ WARN("data at %p is too small\n", data);
+ return FALSE;
+ }
+
+ command.dwMsg = msg;
+ command.abd.hWnd = data->hWnd;
+ command.abd.uCallbackMessage = data->uCallbackMessage;
+ command.abd.uEdge = data->uEdge;
+ command.abd.rc = data->rc;
+ command.abd.lParam = data->lParam;
+
+ return_map = CreateFileMappingW(INVALID_HANDLE_VALUE, 0, PAGE_READWRITE, 0, sizeof(struct appbar_response), NULL);
+ if (return_map == NULL)
+ {
+ ERR("couldn't create file mapping\n");
+ return 0;
+ }
+ command.return_map = HandleToUlong( return_map );
+
+ command.return_process = GetCurrentProcessId();
+
+ appbarmsg_window = FindWindowW(L"Shell_TrayWnd", NULL);
+ if (appbarmsg_window == NULL)
+ {
+ ERR("couldn't find appbar window\n");
+ CloseHandle(return_map);
+ return 0;
+ }
+
+ cds.dwData = TABDMC_APPBAR;
+ cds.cbData = sizeof(command);
+ cds.lpData = &command;
+
+ SendMessageW(appbarmsg_window, WM_COPYDATA, (WPARAM)data->hWnd, (LPARAM)&cds);
+
+ return_view = MapViewOfFile(return_map, FILE_MAP_READ, 0, 0, sizeof(struct appbar_response));
+ if (return_view == NULL)
+ {
+ ERR("MapViewOfFile failed\n");
+ CloseHandle(return_map);
+ return 0;
+ }
+
+ response = return_view;
+
+ ret = response->result;
+ if (ret)
+ {
+ data->hWnd = response->abd.hWnd;
+ data->uCallbackMessage = response->abd.uCallbackMessage;
+ data->uEdge = response->abd.uEdge;
+ data->rc = response->abd.rc;
+ data->lParam = response->abd.lParam;
+ }
+ UnmapViewOfFile(return_view);
+
+ CloseHandle(return_map);
+
+ return ret;
+}
HICON hIcon;
} ABOUT_INFO;
-#define DROP_FIELD_TOP (-15)
-#define DROP_FIELD_HEIGHT 15
-
-/*************************************************************************
- * SHAppBarMessage [SHELL32.@]
- */
-UINT_PTR WINAPI SHAppBarMessage(DWORD msg, PAPPBARDATA data)
-{
- int width=data->rc.right - data->rc.left;
- int height=data->rc.bottom - data->rc.top;
- RECT rec=data->rc;
-
- TRACE("msg=%d, data={cb=%d, hwnd=%p, callback=%x, edge=%d, rc=%s, lparam=%lx}\n",
- msg, data->cbSize, data->hWnd, data->uCallbackMessage, data->uEdge,
- wine_dbgstr_rect(&data->rc), data->lParam);
-
- switch (msg)
- {
- case ABM_GETSTATE:
- return ABS_ALWAYSONTOP | ABS_AUTOHIDE;
-
- case ABM_GETTASKBARPOS:
- GetWindowRect(data->hWnd, &rec);
- data->rc=rec;
- return TRUE;
-
- case ABM_ACTIVATE:
- SetActiveWindow(data->hWnd);
- return TRUE;
-
- case ABM_GETAUTOHIDEBAR:
- return 0; /* pretend there is no autohide bar */
-
- case ABM_NEW:
- /* cbSize, hWnd, and uCallbackMessage are used. All other ignored */
- SetWindowPos(data->hWnd,HWND_TOP,0,0,0,0,SWP_SHOWWINDOW|SWP_NOMOVE|SWP_NOSIZE);
- return TRUE;
-
- case ABM_QUERYPOS:
- GetWindowRect(data->hWnd, &(data->rc));
- return TRUE;
-
- case ABM_REMOVE:
- FIXME("ABM_REMOVE broken\n");
- /* FIXME: this is wrong; should it be DestroyWindow instead? */
- /*CloseHandle(data->hWnd);*/
- return TRUE;
-
- case ABM_SETAUTOHIDEBAR:
- SetWindowPos(data->hWnd,HWND_TOP,rec.left+1000,rec.top,
- width,height,SWP_SHOWWINDOW);
- return TRUE;
-
- case ABM_SETPOS:
- data->uEdge=(ABE_RIGHT | ABE_LEFT);
- SetWindowPos(data->hWnd,HWND_TOP,data->rc.left,data->rc.top,
- width,height,SWP_SHOWWINDOW);
- return TRUE;
-
- case ABM_WINDOWPOSCHANGED:
- return TRUE;
- }
-
- return FALSE;
-}
-
/*************************************************************************
* SHHelpShortcuts_RunDLLA [SHELL32.@]
*
#define SMSET_UNKNOWN08 0x08
#define SMSET_UNKNOWN10 0x10
+// Explorer Tray Application Bar Data Message Commands
+#define TABDMC_APPBAR 0
+#define TABDMC_NOTIFY 1
+#define TABDMC_LOADINPROC 2
+
void WINAPI ShellDDEInit(BOOL bInit);
DWORD WINAPI WinList_Init(void);
IntSendParentNotify(Window, WM_CREATE);
/* Notify the shell that a new window was created */
- if (UserIsDesktopWindow(Window->spwndParent) &&
- Window->spwndOwner == NULL &&
- (Window->style & WS_VISIBLE) &&
- (!(Window->ExStyle & WS_EX_TOOLWINDOW) ||
- (Window->ExStyle & WS_EX_APPWINDOW)))
- {
- co_IntShellHookNotify(HSHELL_WINDOWCREATED, (WPARAM)hWnd, 0);
+ if (Window->spwndOwner == NULL ||
+ !(Window->spwndOwner->style & WS_VISIBLE) ||
+ (Window->spwndOwner->ExStyle & WS_EX_TOOLWINDOW))
+ {
+ if (UserIsDesktopWindow(Window->spwndParent) &&
+ (Window->style & WS_VISIBLE) &&
+ (!(Window->ExStyle & WS_EX_TOOLWINDOW) ||
+ (Window->ExStyle & WS_EX_APPWINDOW)))
+ {
+ co_IntShellHookNotify(HSHELL_WINDOWCREATED, (WPARAM)hWnd, 0);
+ }
}
/* Initialize and show the window's scrollbars */
}
else if (WinPos.flags & SWP_SHOWWINDOW)
{
- if (UserIsDesktopWindow(Window->spwndParent) &&
- Window->spwndOwner == NULL &&
- (!(Window->ExStyle & WS_EX_TOOLWINDOW) ||
- (Window->ExStyle & WS_EX_APPWINDOW)))
- {
- co_IntShellHookNotify(HSHELL_WINDOWCREATED, (WPARAM)Window->head.h, 0);
- if (!(WinPos.flags & SWP_NOACTIVATE))
- UpdateShellHook(Window);
- }
+ if (Window->style & WS_CHILD)
+ {
+ if ((Window->style & WS_POPUP) && (Window->ExStyle & WS_EX_APPWINDOW))
+ {
+ co_IntShellHookNotify(HSHELL_WINDOWCREATED, (WPARAM)Window->head.h, 0);
+ if (!(WinPos.flags & SWP_NOACTIVATE))
+ UpdateShellHook(Window);
+ }
+ }
+ else if ((Window->ExStyle & WS_EX_APPWINDOW) ||
+ (!(Window->ExStyle & WS_EX_TOOLWINDOW) && !Window->spwndOwner &&
+ (!Window->spwndParent || UserIsDesktopWindow(Window->spwndParent))))
+ {
+ co_IntShellHookNotify(HSHELL_WINDOWCREATED, (WPARAM)Window->head.h, 0);
+ if (!(WinPos.flags & SWP_NOACTIVATE))
+ UpdateShellHook(Window);
+ }
Window->style |= WS_VISIBLE; //IntSetStyle( Window, WS_VISIBLE, 0 );
Window->head.pti->cVisWindows++;
Swp |= SWP_NOACTIVATE | SWP_NOZORDER;
/* Fall through. */
case SW_SHOWMINIMIZED:
+ case SW_MINIMIZE: /* CORE-15669: SW_MINIMIZE also shows */
Swp |= SWP_SHOWWINDOW;
- /* Fall through. */
- case SW_MINIMIZE:
{
Swp |= SWP_NOACTIVATE;
if (!(style & WS_MINIMIZE))
default:
//ERR("co_WinPosShowWindow Exit Good 4\n");
- return WasVisible;
+ return FALSE;
}
ShowFlag = (Cmd != SW_HIDE);