2009-03-24 10:09:25 +01:00
|
|
|
/*
|
|
|
|
* Copyright 2009 Henri Verbeet for CodeWeavers
|
2011-07-03 13:35:51 +02:00
|
|
|
* Copyright 2011 André Hentschel
|
2009-03-24 10:09:25 +01:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2012-11-02 10:26:26 +01:00
|
|
|
#include "explorerframe_main.h"
|
2009-03-24 10:09:25 +01:00
|
|
|
|
2011-07-26 12:03:49 +02:00
|
|
|
#include "wine/debug.h"
|
2018-01-30 23:40:57 +01:00
|
|
|
#include "wine/heap.h"
|
2009-03-24 10:09:25 +01:00
|
|
|
|
2013-07-31 12:30:51 +02:00
|
|
|
WINE_DEFAULT_DEBUG_CHANNEL(explorerframe);
|
2009-03-24 10:09:25 +01:00
|
|
|
|
|
|
|
struct taskbar_list
|
|
|
|
{
|
2011-07-03 13:35:51 +02:00
|
|
|
ITaskbarList4 ITaskbarList4_iface;
|
2009-03-24 10:09:25 +01:00
|
|
|
LONG refcount;
|
|
|
|
};
|
|
|
|
|
2011-07-03 13:35:51 +02:00
|
|
|
static inline struct taskbar_list *impl_from_ITaskbarList4(ITaskbarList4 *iface)
|
2011-03-11 11:39:07 +01:00
|
|
|
{
|
2011-07-03 13:35:51 +02:00
|
|
|
return CONTAINING_RECORD(iface, struct taskbar_list, ITaskbarList4_iface);
|
2011-03-11 11:39:07 +01:00
|
|
|
}
|
|
|
|
|
2009-03-24 10:09:25 +01:00
|
|
|
/* IUnknown methods */
|
|
|
|
|
2011-07-03 13:35:51 +02:00
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_QueryInterface(ITaskbarList4 *iface, REFIID riid, void **object)
|
2009-03-24 10:09:25 +01:00
|
|
|
{
|
|
|
|
TRACE("iface %p, riid %s, object %p\n", iface, debugstr_guid(riid), object);
|
|
|
|
|
2011-06-20 22:01:51 +02:00
|
|
|
if (IsEqualGUID(riid, &IID_ITaskbarList) ||
|
|
|
|
IsEqualGUID(riid, &IID_ITaskbarList2) ||
|
2011-07-03 13:35:51 +02:00
|
|
|
IsEqualGUID(riid, &IID_ITaskbarList3) ||
|
|
|
|
IsEqualGUID(riid, &IID_ITaskbarList4) ||
|
2011-06-20 22:01:51 +02:00
|
|
|
IsEqualGUID(riid, &IID_IUnknown))
|
2009-03-24 10:09:25 +01:00
|
|
|
{
|
2012-07-27 11:00:34 +02:00
|
|
|
ITaskbarList4_AddRef(iface);
|
2009-03-24 10:09:25 +01:00
|
|
|
*object = iface;
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid));
|
|
|
|
|
|
|
|
*object = NULL;
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
2011-07-03 13:35:51 +02:00
|
|
|
static ULONG STDMETHODCALLTYPE taskbar_list_AddRef(ITaskbarList4 *iface)
|
2009-03-24 10:09:25 +01:00
|
|
|
{
|
2011-07-03 13:35:51 +02:00
|
|
|
struct taskbar_list *This = impl_from_ITaskbarList4(iface);
|
2009-03-24 10:09:25 +01:00
|
|
|
ULONG refcount = InterlockedIncrement(&This->refcount);
|
|
|
|
|
|
|
|
TRACE("%p increasing refcount to %u\n", This, refcount);
|
|
|
|
|
|
|
|
return refcount;
|
|
|
|
}
|
|
|
|
|
2011-07-03 13:35:51 +02:00
|
|
|
static ULONG STDMETHODCALLTYPE taskbar_list_Release(ITaskbarList4 *iface)
|
2009-03-24 10:09:25 +01:00
|
|
|
{
|
2011-07-03 13:35:51 +02:00
|
|
|
struct taskbar_list *This = impl_from_ITaskbarList4(iface);
|
2009-03-24 10:09:25 +01:00
|
|
|
ULONG refcount = InterlockedDecrement(&This->refcount);
|
|
|
|
|
|
|
|
TRACE("%p decreasing refcount to %u\n", This, refcount);
|
|
|
|
|
|
|
|
if (!refcount)
|
|
|
|
{
|
2011-07-26 12:03:49 +02:00
|
|
|
heap_free(This);
|
2012-11-02 10:26:26 +01:00
|
|
|
EFRAME_UnlockModule();
|
2009-03-24 10:09:25 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
return refcount;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ITaskbarList methods */
|
|
|
|
|
2011-07-03 13:35:51 +02:00
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_HrInit(ITaskbarList4 *iface)
|
2009-03-24 10:09:25 +01:00
|
|
|
{
|
2010-03-02 05:55:00 +01:00
|
|
|
TRACE("iface %p\n", iface);
|
2009-03-24 10:09:25 +01:00
|
|
|
|
2010-03-02 05:55:00 +01:00
|
|
|
return S_OK;
|
2009-03-24 10:09:25 +01:00
|
|
|
}
|
|
|
|
|
2011-07-03 13:35:51 +02:00
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_AddTab(ITaskbarList4 *iface, HWND hwnd)
|
2009-03-24 10:09:25 +01:00
|
|
|
{
|
|
|
|
FIXME("iface %p, hwnd %p stub!\n", iface, hwnd);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-07-03 13:35:51 +02:00
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_DeleteTab(ITaskbarList4 *iface, HWND hwnd)
|
2009-03-24 10:09:25 +01:00
|
|
|
{
|
|
|
|
FIXME("iface %p, hwnd %p stub!\n", iface, hwnd);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-07-03 13:35:51 +02:00
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_ActivateTab(ITaskbarList4 *iface, HWND hwnd)
|
2009-03-24 10:09:25 +01:00
|
|
|
{
|
|
|
|
FIXME("iface %p, hwnd %p stub!\n", iface, hwnd);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-07-03 13:35:51 +02:00
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_SetActiveAlt(ITaskbarList4 *iface, HWND hwnd)
|
2009-03-24 10:09:25 +01:00
|
|
|
{
|
|
|
|
FIXME("iface %p, hwnd %p stub!\n", iface, hwnd);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-06-20 22:01:51 +02:00
|
|
|
/* ITaskbarList2 method */
|
|
|
|
|
2011-07-03 13:35:51 +02:00
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_MarkFullscreenWindow(ITaskbarList4 *iface,
|
2011-06-20 22:01:51 +02:00
|
|
|
HWND hwnd,
|
|
|
|
BOOL fullscreen)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, hwnd %p, fullscreen %s stub!\n", iface, hwnd, (fullscreen)?"true":"false");
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
2011-07-03 13:35:51 +02:00
|
|
|
/* ITaskbarList3 methods */
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_SetProgressValue(ITaskbarList4 *iface,
|
|
|
|
HWND hwnd,
|
|
|
|
ULONGLONG ullCompleted,
|
|
|
|
ULONGLONG ullTotal)
|
|
|
|
{
|
2011-08-10 23:00:52 +02:00
|
|
|
static BOOL fixme_once;
|
|
|
|
if(!fixme_once++) FIXME("iface %p, hwnd %p, ullCompleted %s, ullTotal %s stub!\n", iface, hwnd,
|
|
|
|
wine_dbgstr_longlong(ullCompleted), wine_dbgstr_longlong(ullTotal));
|
2011-07-03 13:35:51 +02:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_SetProgressState(ITaskbarList4 *iface,
|
|
|
|
HWND hwnd,
|
|
|
|
TBPFLAG tbpFlags)
|
|
|
|
{
|
2011-08-10 23:00:52 +02:00
|
|
|
static BOOL fixme_once;
|
|
|
|
if(!fixme_once++) FIXME("iface %p, hwnd %p, flags %x stub!\n", iface, hwnd, tbpFlags);
|
2011-07-03 13:35:51 +02:00
|
|
|
|
|
|
|
return S_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_RegisterTab(ITaskbarList4 *iface, HWND hwndTab, HWND hwndMDI)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, hwndTab %p, hwndMDI %p stub!\n", iface, hwndTab, hwndMDI);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_UnregisterTab(ITaskbarList4 *iface, HWND hwndTab)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, hwndTab %p stub!\n", iface, hwndTab);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_SetTabOrder(ITaskbarList4 *iface,
|
|
|
|
HWND hwndTab,
|
|
|
|
HWND hwndInsertBefore)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, hwndTab %p, hwndInsertBefore %p stub!\n", iface, hwndTab, hwndInsertBefore);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_SetTabActive(ITaskbarList4 *iface,
|
|
|
|
HWND hwndTab,
|
|
|
|
HWND hwndMDI,
|
|
|
|
DWORD dwReserved)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, hwndTab %p, hwndMDI %p, dwReserved %x stub!\n", iface, hwndTab, hwndMDI, dwReserved);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_ThumbBarAddButtons(ITaskbarList4 *iface,
|
|
|
|
HWND hwnd,
|
|
|
|
UINT cButtons,
|
|
|
|
LPTHUMBBUTTON pButton)
|
|
|
|
{
|
2019-03-18 17:42:26 +01:00
|
|
|
FIXME("iface %p, hwnd %p, cButtons %u, pButton %p stub, faking success!\n", iface, hwnd, cButtons, pButton);
|
2011-07-03 13:35:51 +02:00
|
|
|
|
2019-03-18 17:42:26 +01:00
|
|
|
return S_OK;
|
2011-07-03 13:35:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_ThumbBarUpdateButtons(ITaskbarList4 *iface,
|
|
|
|
HWND hwnd,
|
|
|
|
UINT cButtons,
|
|
|
|
LPTHUMBBUTTON pButton)
|
|
|
|
{
|
2019-03-18 17:42:27 +01:00
|
|
|
FIXME("iface %p, hwnd %p, cButtons %u, pButton %p stub, faking success!\n", iface, hwnd, cButtons, pButton);
|
2011-07-03 13:35:51 +02:00
|
|
|
|
2019-03-18 17:42:27 +01:00
|
|
|
return S_OK;
|
2011-07-03 13:35:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_ThumbBarSetImageList(ITaskbarList4 *iface,
|
|
|
|
HWND hwnd,
|
|
|
|
HIMAGELIST himl)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, hwnd %p, himl %p stub!\n", iface, hwnd, himl);
|
|
|
|
|
2019-11-28 07:09:32 +01:00
|
|
|
return S_OK;
|
2011-07-03 13:35:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_SetOverlayIcon(ITaskbarList4 *iface,
|
|
|
|
HWND hwnd,
|
|
|
|
HICON hIcon,
|
|
|
|
LPCWSTR pszDescription)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, hwnd %p, hIcon %p, pszDescription %s stub!\n", iface, hwnd, hIcon,
|
|
|
|
debugstr_w(pszDescription));
|
|
|
|
|
2020-06-05 13:33:57 +02:00
|
|
|
return S_OK;
|
2011-07-03 13:35:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_SetThumbnailTooltip(ITaskbarList4 *iface,
|
|
|
|
HWND hwnd,
|
|
|
|
LPCWSTR pszTip)
|
|
|
|
{
|
2019-03-18 17:42:25 +01:00
|
|
|
FIXME("iface %p, hwnd %p, pszTip %s stub, faking success!\n", iface, hwnd, debugstr_w(pszTip));
|
2011-07-03 13:35:51 +02:00
|
|
|
|
2019-03-18 17:42:25 +01:00
|
|
|
return S_OK;
|
2011-07-03 13:35:51 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_SetThumbnailClip(ITaskbarList4 *iface,
|
|
|
|
HWND hwnd,
|
|
|
|
RECT *prcClip)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, hwnd %p, prcClip %s stub!\n", iface, hwnd, wine_dbgstr_rect(prcClip));
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* ITaskbarList4 method */
|
|
|
|
|
|
|
|
static HRESULT STDMETHODCALLTYPE taskbar_list_SetTabProperties(ITaskbarList4 *iface,
|
|
|
|
HWND hwndTab,
|
|
|
|
STPFLAG stpFlags)
|
|
|
|
{
|
|
|
|
FIXME("iface %p, hwndTab %p, stpFlags %u stub!\n", iface, hwndTab, stpFlags);
|
|
|
|
|
|
|
|
return E_NOTIMPL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const struct ITaskbarList4Vtbl taskbar_list_vtbl =
|
2009-03-24 10:09:25 +01:00
|
|
|
{
|
|
|
|
/* IUnknown methods */
|
|
|
|
taskbar_list_QueryInterface,
|
|
|
|
taskbar_list_AddRef,
|
|
|
|
taskbar_list_Release,
|
|
|
|
/* ITaskbarList methods */
|
|
|
|
taskbar_list_HrInit,
|
|
|
|
taskbar_list_AddTab,
|
|
|
|
taskbar_list_DeleteTab,
|
|
|
|
taskbar_list_ActivateTab,
|
|
|
|
taskbar_list_SetActiveAlt,
|
2011-06-20 22:01:51 +02:00
|
|
|
/* ITaskbarList2 method */
|
|
|
|
taskbar_list_MarkFullscreenWindow,
|
2011-07-03 13:35:51 +02:00
|
|
|
/* ITaskbarList3 methods */
|
|
|
|
taskbar_list_SetProgressValue,
|
|
|
|
taskbar_list_SetProgressState,
|
|
|
|
taskbar_list_RegisterTab,
|
|
|
|
taskbar_list_UnregisterTab,
|
|
|
|
taskbar_list_SetTabOrder,
|
|
|
|
taskbar_list_SetTabActive,
|
|
|
|
taskbar_list_ThumbBarAddButtons,
|
|
|
|
taskbar_list_ThumbBarUpdateButtons,
|
|
|
|
taskbar_list_ThumbBarSetImageList,
|
|
|
|
taskbar_list_SetOverlayIcon,
|
|
|
|
taskbar_list_SetThumbnailTooltip,
|
|
|
|
taskbar_list_SetThumbnailClip,
|
|
|
|
/* ITaskbarList4 method */
|
|
|
|
taskbar_list_SetTabProperties,
|
2009-03-24 10:09:25 +01:00
|
|
|
};
|
|
|
|
|
2012-11-02 10:26:26 +01:00
|
|
|
HRESULT TaskbarList_Constructor(IUnknown *outer, REFIID riid, void **taskbar_list)
|
2009-03-24 10:09:25 +01:00
|
|
|
{
|
|
|
|
struct taskbar_list *object;
|
2011-07-26 12:03:49 +02:00
|
|
|
HRESULT hres;
|
2009-03-24 10:09:25 +01:00
|
|
|
|
|
|
|
TRACE("outer %p, riid %s, taskbar_list %p\n", outer, debugstr_guid(riid), taskbar_list);
|
|
|
|
|
|
|
|
if (outer)
|
|
|
|
{
|
|
|
|
WARN("Aggregation not supported\n");
|
2009-06-16 09:38:25 +02:00
|
|
|
*taskbar_list = NULL;
|
2009-03-24 10:09:25 +01:00
|
|
|
return CLASS_E_NOAGGREGATION;
|
|
|
|
}
|
|
|
|
|
2012-11-02 10:26:26 +01:00
|
|
|
object = heap_alloc(sizeof(*object));
|
2009-03-24 10:09:25 +01:00
|
|
|
if (!object)
|
|
|
|
{
|
|
|
|
ERR("Failed to allocate taskbar list object memory\n");
|
2009-06-16 09:38:25 +02:00
|
|
|
*taskbar_list = NULL;
|
2009-03-24 10:09:25 +01:00
|
|
|
return E_OUTOFMEMORY;
|
|
|
|
}
|
|
|
|
|
2011-07-03 13:35:51 +02:00
|
|
|
object->ITaskbarList4_iface.lpVtbl = &taskbar_list_vtbl;
|
2011-07-26 12:03:49 +02:00
|
|
|
object->refcount = 1;
|
2012-11-02 10:26:26 +01:00
|
|
|
EFRAME_LockModule();
|
2009-03-24 10:09:25 +01:00
|
|
|
|
2011-07-03 13:35:51 +02:00
|
|
|
TRACE("Created ITaskbarList4 %p\n", object);
|
2009-03-24 10:09:25 +01:00
|
|
|
|
2011-07-26 12:03:49 +02:00
|
|
|
hres = ITaskbarList4_QueryInterface(&object->ITaskbarList4_iface, riid, taskbar_list);
|
|
|
|
ITaskbarList4_Release(&object->ITaskbarList4_iface);
|
|
|
|
return hres;
|
2009-03-24 10:09:25 +01:00
|
|
|
}
|