2 * Copyright 2009 Henri Verbeet for CodeWeavers
3 * Copyright 2011 André Hentschel
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include "explorerframe_main.h"
23 #include "wine/debug.h"
25 WINE_DEFAULT_DEBUG_CHANNEL(explorerframe
);
27 #define WM_WINE_DELETE_TAB (WM_USER + 1)
28 #define WM_WINE_ADD_TAB (WM_USER + 2)
32 ITaskbarList4 ITaskbarList4_iface
;
36 static inline struct taskbar_list
*impl_from_ITaskbarList4(ITaskbarList4
*iface
)
38 return CONTAINING_RECORD(iface
, struct taskbar_list
, ITaskbarList4_iface
);
41 /* IUnknown methods */
43 static HRESULT STDMETHODCALLTYPE
taskbar_list_QueryInterface(ITaskbarList4
*iface
, REFIID riid
, void **object
)
45 TRACE("iface %p, riid %s, object %p\n", iface
, debugstr_guid(riid
), object
);
47 if (IsEqualGUID(riid
, &IID_ITaskbarList
) ||
48 IsEqualGUID(riid
, &IID_ITaskbarList2
) ||
49 IsEqualGUID(riid
, &IID_ITaskbarList3
) ||
50 IsEqualGUID(riid
, &IID_ITaskbarList4
) ||
51 IsEqualGUID(riid
, &IID_IUnknown
))
53 ITaskbarList4_AddRef(iface
);
58 WARN("%s not implemented, returning E_NOINTERFACE\n", debugstr_guid(riid
));
64 static ULONG STDMETHODCALLTYPE
taskbar_list_AddRef(ITaskbarList4
*iface
)
66 struct taskbar_list
*This
= impl_from_ITaskbarList4(iface
);
67 ULONG refcount
= InterlockedIncrement(&This
->refcount
);
69 TRACE("%p increasing refcount to %lu\n", This
, refcount
);
74 static ULONG STDMETHODCALLTYPE
taskbar_list_Release(ITaskbarList4
*iface
)
76 struct taskbar_list
*This
= impl_from_ITaskbarList4(iface
);
77 ULONG refcount
= InterlockedDecrement(&This
->refcount
);
79 TRACE("%p decreasing refcount to %lu\n", This
, refcount
);
84 EFRAME_UnlockModule();
90 /* ITaskbarList methods */
92 static HRESULT STDMETHODCALLTYPE
taskbar_list_HrInit(ITaskbarList4
*iface
)
94 TRACE("iface %p\n", iface
);
99 static HRESULT STDMETHODCALLTYPE
taskbar_list_AddTab(ITaskbarList4
*iface
, HWND hwnd
)
101 TRACE("iface %p, hwnd %p\n", iface
, hwnd
);
103 SendMessageW(GetDesktopWindow(), WM_WINE_ADD_TAB
, (WPARAM
)hwnd
, 0);
107 static HRESULT STDMETHODCALLTYPE
taskbar_list_DeleteTab(ITaskbarList4
*iface
, HWND hwnd
)
109 TRACE("iface %p, hwnd %p\n", iface
, hwnd
);
111 SendMessageW(GetDesktopWindow(), WM_WINE_DELETE_TAB
, (WPARAM
)hwnd
, 0);
115 static HRESULT STDMETHODCALLTYPE
taskbar_list_ActivateTab(ITaskbarList4
*iface
, HWND hwnd
)
117 FIXME("iface %p, hwnd %p stub!\n", iface
, hwnd
);
122 static HRESULT STDMETHODCALLTYPE
taskbar_list_SetActiveAlt(ITaskbarList4
*iface
, HWND hwnd
)
124 FIXME("iface %p, hwnd %p stub!\n", iface
, hwnd
);
129 /* ITaskbarList2 method */
131 static HRESULT STDMETHODCALLTYPE
taskbar_list_MarkFullscreenWindow(ITaskbarList4
*iface
,
135 FIXME("iface %p, hwnd %p, fullscreen %s stub!\n", iface
, hwnd
, (fullscreen
)?"true":"false");
140 /* ITaskbarList3 methods */
142 static HRESULT STDMETHODCALLTYPE
taskbar_list_SetProgressValue(ITaskbarList4
*iface
,
144 ULONGLONG ullCompleted
,
147 static BOOL fixme_once
;
148 if(!fixme_once
++) FIXME("iface %p, hwnd %p, ullCompleted %s, ullTotal %s stub!\n", iface
, hwnd
,
149 wine_dbgstr_longlong(ullCompleted
), wine_dbgstr_longlong(ullTotal
));
154 static HRESULT STDMETHODCALLTYPE
taskbar_list_SetProgressState(ITaskbarList4
*iface
,
158 static BOOL fixme_once
;
159 if(!fixme_once
++) FIXME("iface %p, hwnd %p, flags %x stub!\n", iface
, hwnd
, tbpFlags
);
164 static HRESULT STDMETHODCALLTYPE
taskbar_list_RegisterTab(ITaskbarList4
*iface
, HWND hwndTab
, HWND hwndMDI
)
166 FIXME("iface %p, hwndTab %p, hwndMDI %p stub!\n", iface
, hwndTab
, hwndMDI
);
171 static HRESULT STDMETHODCALLTYPE
taskbar_list_UnregisterTab(ITaskbarList4
*iface
, HWND hwndTab
)
173 FIXME("iface %p, hwndTab %p stub!\n", iface
, hwndTab
);
178 static HRESULT STDMETHODCALLTYPE
taskbar_list_SetTabOrder(ITaskbarList4
*iface
,
180 HWND hwndInsertBefore
)
182 FIXME("iface %p, hwndTab %p, hwndInsertBefore %p stub!\n", iface
, hwndTab
, hwndInsertBefore
);
187 static HRESULT STDMETHODCALLTYPE
taskbar_list_SetTabActive(ITaskbarList4
*iface
,
192 FIXME("iface %p, hwndTab %p, hwndMDI %p, dwReserved %lx stub!\n", iface
, hwndTab
, hwndMDI
, dwReserved
);
197 static HRESULT STDMETHODCALLTYPE
taskbar_list_ThumbBarAddButtons(ITaskbarList4
*iface
,
200 LPTHUMBBUTTON pButton
)
202 FIXME("iface %p, hwnd %p, cButtons %u, pButton %p stub, faking success!\n", iface
, hwnd
, cButtons
, pButton
);
207 static HRESULT STDMETHODCALLTYPE
taskbar_list_ThumbBarUpdateButtons(ITaskbarList4
*iface
,
210 LPTHUMBBUTTON pButton
)
212 FIXME("iface %p, hwnd %p, cButtons %u, pButton %p stub, faking success!\n", iface
, hwnd
, cButtons
, pButton
);
217 static HRESULT STDMETHODCALLTYPE
taskbar_list_ThumbBarSetImageList(ITaskbarList4
*iface
,
221 FIXME("iface %p, hwnd %p, himl %p stub!\n", iface
, hwnd
, himl
);
226 static HRESULT STDMETHODCALLTYPE
taskbar_list_SetOverlayIcon(ITaskbarList4
*iface
,
229 LPCWSTR pszDescription
)
231 FIXME("iface %p, hwnd %p, hIcon %p, pszDescription %s stub!\n", iface
, hwnd
, hIcon
,
232 debugstr_w(pszDescription
));
237 static HRESULT STDMETHODCALLTYPE
taskbar_list_SetThumbnailTooltip(ITaskbarList4
*iface
,
241 FIXME("iface %p, hwnd %p, pszTip %s stub, faking success!\n", iface
, hwnd
, debugstr_w(pszTip
));
246 static HRESULT STDMETHODCALLTYPE
taskbar_list_SetThumbnailClip(ITaskbarList4
*iface
,
250 FIXME("iface %p, hwnd %p, prcClip %s stub!\n", iface
, hwnd
, wine_dbgstr_rect(prcClip
));
255 /* ITaskbarList4 method */
257 static HRESULT STDMETHODCALLTYPE
taskbar_list_SetTabProperties(ITaskbarList4
*iface
,
261 FIXME("iface %p, hwndTab %p, stpFlags %u stub!\n", iface
, hwndTab
, stpFlags
);
266 static const struct ITaskbarList4Vtbl taskbar_list_vtbl
=
268 /* IUnknown methods */
269 taskbar_list_QueryInterface
,
271 taskbar_list_Release
,
272 /* ITaskbarList methods */
275 taskbar_list_DeleteTab
,
276 taskbar_list_ActivateTab
,
277 taskbar_list_SetActiveAlt
,
278 /* ITaskbarList2 method */
279 taskbar_list_MarkFullscreenWindow
,
280 /* ITaskbarList3 methods */
281 taskbar_list_SetProgressValue
,
282 taskbar_list_SetProgressState
,
283 taskbar_list_RegisterTab
,
284 taskbar_list_UnregisterTab
,
285 taskbar_list_SetTabOrder
,
286 taskbar_list_SetTabActive
,
287 taskbar_list_ThumbBarAddButtons
,
288 taskbar_list_ThumbBarUpdateButtons
,
289 taskbar_list_ThumbBarSetImageList
,
290 taskbar_list_SetOverlayIcon
,
291 taskbar_list_SetThumbnailTooltip
,
292 taskbar_list_SetThumbnailClip
,
293 /* ITaskbarList4 method */
294 taskbar_list_SetTabProperties
,
297 HRESULT
TaskbarList_Constructor(IUnknown
*outer
, REFIID riid
, void **taskbar_list
)
299 struct taskbar_list
*object
;
302 TRACE("outer %p, riid %s, taskbar_list %p\n", outer
, debugstr_guid(riid
), taskbar_list
);
306 WARN("Aggregation not supported\n");
307 *taskbar_list
= NULL
;
308 return CLASS_E_NOAGGREGATION
;
311 object
= malloc(sizeof(*object
));
314 ERR("Failed to allocate taskbar list object memory\n");
315 *taskbar_list
= NULL
;
316 return E_OUTOFMEMORY
;
319 object
->ITaskbarList4_iface
.lpVtbl
= &taskbar_list_vtbl
;
320 object
->refcount
= 1;
323 TRACE("Created ITaskbarList4 %p\n", object
);
325 hres
= ITaskbarList4_QueryInterface(&object
->ITaskbarList4_iface
, riid
, taskbar_list
);
326 ITaskbarList4_Release(&object
->ITaskbarList4_iface
);