4 * Copyright 2007 Hervé Poussineua
5 * Copyright 2009 Andrew Hill
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.
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.
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
22 #include "shellbars.h"
24 CBandSiteMenu::CBandSiteMenu()
28 CBandSiteMenu::~CBandSiteMenu()
32 HRESULT STDMETHODCALLTYPE
CBandSiteMenu::SetOwner(IUnknown
*pOwner
)
34 TRACE("CBandSiteMenu::SetOwner(%p, %p)\n", this, pOwner
);
39 HRESULT STDMETHODCALLTYPE
CBandSiteMenu::QueryContextMenu(
40 HMENU hmenu
, UINT indexMenu
, UINT idCmdFirst
, UINT idCmdLast
, UINT uFlags
)
45 TRACE("CBandSiteMenu::QueryContextMenu(%p, %p, %u, %u, %u, 0x%x)\n", this, hmenu
, indexMenu
, idCmdFirst
, idCmdLast
, uFlags
);
47 HMENU hm
= LoadMenuW(_AtlBaseModule
.GetResourceInstance(), MAKEINTRESOURCEW(IDM_TASKBAR_TOOLBARS
));
49 return HRESULT_FROM_WIN32(GetLastError());
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
);
56 return HRESULT_FROM_WIN32(GetLastError());
58 mii
.dwTypeData
= buffer
;
59 mii
.cch
= mii
.cch
+ 1;
61 ret
= GetMenuItemInfoW(hm
, 0, TRUE
, &mii
);
63 return HRESULT_FROM_WIN32(GetLastError());
65 ret
= InsertMenuItemW(hmenu
, 0, TRUE
, &mii
);
67 RemoveMenu(hm
, 0, MF_BYPOSITION
);
72 HRESULT STDMETHODCALLTYPE
CBandSiteMenu::InvokeCommand(LPCMINVOKECOMMANDINFO lpici
)
74 FIXME("CBandSiteMenu::InvokeCommand is UNIMPLEMENTED (%p, %p)\n", this, lpici
);
78 HRESULT STDMETHODCALLTYPE
CBandSiteMenu::GetCommandString(UINT_PTR idCmd
, UINT uType
,
79 UINT
*pwReserved
, LPSTR pszName
, UINT cchMax
)
81 FIXME("CBandSiteMenu::GetCommandString is UNIMPLEMENTED (%p, %p, %u, %p, %p, %u)\n", this, idCmd
, uType
, pwReserved
, pszName
, cchMax
);
85 HRESULT STDMETHODCALLTYPE
CBandSiteMenu::HandleMenuMsg(UINT uMsg
, WPARAM wParam
, LPARAM lParam
)
87 FIXME("CBandSiteMenu::HandleMenuMsg is UNIMPLEMENTED (%p, %u, %p, %p)\n", this, uMsg
, wParam
, lParam
);
91 HRESULT STDMETHODCALLTYPE
CBandSiteMenu::HandleMenuMsg2(UINT uMsg
, WPARAM wParam
, LPARAM lParam
, LRESULT
*plResult
)
93 FIXME("CBandSiteMenu::HandleMenuMsg2 is UNIMPLEMENTED(%p, %u, %p, %p, %p)\n", this, uMsg
, wParam
, lParam
, plResult
);
98 HRESULT WINAPI
CBandSiteMenu_CreateInstance(REFIID riid
, void **ppv
)
100 return ShellObjectCreator
<CBandSiteMenu
>(riid
, ppv
);