[RSHELL] -Link to shellbars and export CBandSite_CreateInstance and CBandSiteMenu_Cre...
[reactos.git] / reactos / dll / win32 / browseui / shellbars / CBandSiteMenu.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 "shellbars.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 WCHAR buffer[100];
44
45 TRACE("CBandSiteMenu::QueryContextMenu(%p, %p, %u, %u, %u, 0x%x)\n", this, hmenu, indexMenu, idCmdFirst, idCmdLast, uFlags);
46
47 HMENU hm = LoadMenuW(_AtlBaseModule.GetResourceInstance(), MAKEINTRESOURCEW(IDM_TASKBAR_TOOLBARS));
48 if (!hm)
49 return HRESULT_FROM_WIN32(GetLastError());
50
51 MENUITEMINFOW mii = { 0 };
52 mii.cbSize = sizeof(mii);
53 mii.fMask = MIIM_FTYPE | MIIM_ID | MIIM_STATE | MIIM_STRING | MIIM_SUBMENU;
54 ret = GetMenuItemInfoW(hm, 0, TRUE, &mii);
55 if (!hm)
56 return HRESULT_FROM_WIN32(GetLastError());
57
58 mii.dwTypeData = buffer;
59 mii.cch = mii.cch + 1;
60
61 ret = GetMenuItemInfoW(hm, 0, TRUE, &mii);
62 if (!hm)
63 return HRESULT_FROM_WIN32(GetLastError());
64
65 ret = InsertMenuItemW(hmenu, 0, TRUE, &mii);
66
67 RemoveMenu(hm, 0, MF_BYPOSITION);
68
69 return E_NOTIMPL;
70 }
71
72 HRESULT STDMETHODCALLTYPE CBandSiteMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpici)
73 {
74 FIXME("CBandSiteMenu::InvokeCommand is UNIMPLEMENTED (%p, %p)\n", this, lpici);
75 return S_OK;
76 }
77
78 HRESULT STDMETHODCALLTYPE CBandSiteMenu::GetCommandString(UINT_PTR idCmd, UINT uType,
79 UINT *pwReserved, LPSTR pszName, UINT cchMax)
80 {
81 FIXME("CBandSiteMenu::GetCommandString is UNIMPLEMENTED (%p, %p, %u, %p, %p, %u)\n", this, idCmd, uType, pwReserved, pszName, cchMax);
82 return E_NOTIMPL;
83 }
84
85 HRESULT STDMETHODCALLTYPE CBandSiteMenu::HandleMenuMsg(UINT uMsg, WPARAM wParam, LPARAM lParam)
86 {
87 FIXME("CBandSiteMenu::HandleMenuMsg is UNIMPLEMENTED (%p, %u, %p, %p)\n", this, uMsg, wParam, lParam);
88 return E_NOTIMPL;
89 }
90
91 HRESULT STDMETHODCALLTYPE CBandSiteMenu::HandleMenuMsg2(UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT *plResult)
92 {
93 FIXME("CBandSiteMenu::HandleMenuMsg2 is UNIMPLEMENTED(%p, %u, %p, %p, %p)\n", this, uMsg, wParam, lParam, plResult);
94 return E_NOTIMPL;
95 }
96
97 extern "C"
98 HRESULT WINAPI CBandSiteMenu_CreateInstance(REFIID riid, void **ppv)
99 {
100 return ShellObjectCreator<CBandSiteMenu>(riid, ppv);
101 }