3c9d10c8489cd874c7feca5b9c191ea674761421
[reactos.git] / reactos / dll / win32 / browseui / bandsitemenu.cpp
1 /*
2 * Band site menu
3 *
4 * Copyright 2007 Hervé Poussineua
5 * Copyright 2009 Andrew Hill
6 *
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
20 */
21
22 #include "precomp.h"
23
24 CBandSiteMenu::CBandSiteMenu()
25 {
26 }
27
28 CBandSiteMenu::~CBandSiteMenu()
29 {
30 }
31
32 HRESULT STDMETHODCALLTYPE CBandSiteMenu::SetOwner(IUnknown *pOwner)
33 {
34 TRACE("CBandSiteMenu::SetOwner(%p, %p)\n", this, pOwner);
35 m_Owner = pOwner;
36 return S_OK;
37 }
38
39 HRESULT STDMETHODCALLTYPE CBandSiteMenu::QueryContextMenu(
40 HMENU hmenu, UINT indexMenu, UINT idCmdFirst, UINT idCmdLast, UINT uFlags)
41 {
42 BOOL ret;
43
44 TRACE("CBandSiteMenu::QueryContextMenu(%p, %p, %u, %u, %u, 0x%x)\n", this, hmenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
45
46 HMENU hm = LoadMenuW(_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCEW(IDM_TASKBAR_TOOLBARS));
47 if (!hm)
48 return HRESULT_FROM_WIN32(GetLastError());
49
50 MENUITEMINFOW mii = { 0 };
51 mii.cbSize = sizeof(mii);
52 mii.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STATE | MIIM_STRING | MIIM_SUBMENU;
53 ret = GetMenuItemInfoW(hm, 0, TRUE, &mii);
54 if (!hm)
55 return HRESULT_FROM_WIN32(GetLastError());
56
57 mii.dwTypeData = new WCHAR[mii.cch + 1];
58 mii.cch = mii.cch + 1;
59
60 ret = GetMenuItemInfoW(hm, 0, TRUE, &mii);
61 if (!hm)
62 return HRESULT_FROM_WIN32(GetLastError());
63
64 ret = InsertMenuItemW(hmenu, 0, TRUE, &mii);
65
66 delete mii.dwTypeData;
67
68 RemoveMenu(hm, 0, MF_BYPOSITION);
69
70 return E_NOTIMPL;
71 }
72
73 HRESULT STDMETHODCALLTYPE CBandSiteMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
74 {
75 FIXME("CBandSiteMenu::InvokeCommand is UNIMPLEMENTED (%p, %p)\n", this, lpici);
76 return S_OK;
77 }
78
79 HRESULT STDMETHODCALLTYPE CBandSiteMenu::GetCommandString(UINT_PTR idCmd, UINT uType,
80 UINT *pwReserved, LPSTR pszName, UINT cchMax)
81 {
82 FIXME("CBandSiteMenu::GetCommandString is UNIMPLEMENTED (%p, %p, %u, %p, %p, %u)\n", this, idCmd, uType, pwReserved, pszName, cchMax);
83 return E_NOTIMPL;
84 }
85
86 HRESULT STDMETHODCALLTYPE CBandSiteMenu::HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam)
87 {
88 FIXME("CBandSiteMenu::HandleMenuMsg is UNIMPLEMENTED (%p, %u, %p, %p)\n", this, uMsg, wParam, lParam);
89 return E_NOTIMPL;
90 }
91
92 HRESULT STDMETHODCALLTYPE CBandSiteMenu::HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult)
93 {
94 FIXME("CBandSiteMenu::HandleMenuMsg2 is UNIMPLEMENTED(%p, %u, %p, %p, %p)\n", this, uMsg, wParam, lParam, plResult);
95 return E_NOTIMPL;
96 }