Author: dquintana
Date: Wed Feb 19 00:20:45 2014
New Revision: 62252
URL:
http://svn.reactos.org/svn/reactos?rev=62252&view=rev
Log:
[RSHELL]
* Separate logger wrappers from the actual implementations.
* Fix some warnings.
CORE-7586
Added:
branches/shell-experiments/base/shell/rshell/logging/ (with props)
branches/shell-experiments/base/shell/rshell/logging/CMenuBandWrap.cpp (with props)
branches/shell-experiments/base/shell/rshell/logging/CMenuDeskBarWrap.cpp (with
props)
Modified:
branches/shell-experiments/base/shell/rshell/CMakeLists.txt
branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp
branches/shell-experiments/base/shell/rshell/CStartMenu.cpp
branches/shell-experiments/base/shell/rshell/precomp.h
Modified: branches/shell-experiments/base/shell/rshell/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMakeLists.txt [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMakeLists.txt [iso-8859-1] Wed Feb 19
00:20:45 2014
@@ -14,6 +14,8 @@
CStartMenu.cpp
misc.cpp
wraplog.cpp
+ logging/CMenuBandWrap.cpp
+ logging/CMenuDeskBarWrap.cpp
${CMAKE_CURRENT_BINARY_DIR}/rshell.def)
add_library(rshell SHARED ${SOURCE})
Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuBand.cpp [iso-8859-1] Wed Feb 19
00:20:45 2014
@@ -18,12 +18,9 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "precomp.h"
-#include "wraplog.h"
#include <windowsx.h>
WINE_DEFAULT_DEBUG_CHANNEL(CMenuBand);
-
-#define WRAP_LOG 0
#define TBSTYLE_EX_VERTICAL 4
@@ -135,25 +132,6 @@
~CMenuBand();
private:
-#if WRAP_LOG
- IUnknown * m_IUnknown;
- IDeskBand * m_IDeskBand;
- IDockingWindow * m_IDockingWindow;
- IOleWindow * m_IOleWindow;
- IObjectWithSite * m_IObjectWithSite;
- IInputObject * m_IInputObject;
- IPersistStream * m_IPersistStream;
- IPersist * m_IPersist;
- IOleCommandTarget * m_IOleCommandTarget;
- IServiceProvider * m_IServiceProvider;
- IMenuPopup * m_IMenuPopup;
- IDeskBar * m_IDeskBar;
- IMenuBand * m_IMenuBand;
- IShellMenu2 * m_IShellMenu2;
- IShellMenu * m_IShellMenu;
- IWinEventHandler * m_IWinEventHandler;
- IShellMenuAcc * m_IShellMenuAcc;
-#else
IOleWindow *m_site;
IShellMenuCallback *m_psmc;
@@ -166,7 +144,6 @@
PVOID m_UserData;
HMENU m_hmenu;
HWND m_menuOwner;
-#endif
BOOL m_useBigIcons;
@@ -256,7 +233,7 @@
HRESULT CallCBWithId(UINT Id, UINT uMsg, WPARAM wParam, LPARAM lParam);
HRESULT CallCBWithPidl(LPITEMIDLIST pidl, UINT uMsg, WPARAM wParam, LPARAM lParam);
- HRESULT TrackPopup(HMENU popup, INT x, INT y, RECT& rc);
+ HRESULT TrackPopup(HMENU popup, INT x, INT y);
BOOL UseBigIcons() {
return m_useBigIcons;
@@ -306,555 +283,6 @@
return hr;
}
-
-#if WRAP_LOG
-CMenuBand::CMenuBand()
-{
- HRESULT hr;
- WrapLogOpen();
-
- hr = CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IShellMenu, &m_IShellMenu));
- hr = m_IShellMenu->QueryInterface(IID_PPV_ARG(IUnknown, &m_IUnknown));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IDeskBand, &m_IDeskBand));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IDockingWindow,
&m_IDockingWindow));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IOleWindow, &m_IOleWindow));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IObjectWithSite,
&m_IObjectWithSite));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IInputObject, &m_IInputObject));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IPersistStream,
&m_IPersistStream));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IPersist, &m_IPersist));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IOleCommandTarget,
&m_IOleCommandTarget));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IServiceProvider,
&m_IServiceProvider));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IMenuPopup, &m_IMenuPopup));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IDeskBar, &m_IDeskBar));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IMenuBand, &m_IMenuBand));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IShellMenu2, &m_IShellMenu2));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IWinEventHandler,
&m_IWinEventHandler));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IShellMenuAcc,
&m_IShellMenuAcc));
-}
-
-CMenuBand::~CMenuBand()
-{
- m_IUnknown->Release();
- m_IDeskBand->Release();
- m_IDockingWindow->Release();
- m_IOleWindow->Release();
- m_IObjectWithSite->Release();
- m_IInputObject->Release();
- m_IPersistStream->Release();
- m_IPersist->Release();
- m_IOleCommandTarget->Release();
- m_IServiceProvider->Release();
- m_IMenuPopup->Release();
- m_IDeskBar->Release();
- m_IMenuBand->Release();
- m_IShellMenu2->Release();
- m_IShellMenu->Release();
- m_IWinEventHandler->Release();
- m_IShellMenuAcc->Release();
- WrapLogClose();
-}
-
-
-// *** IShellMenu2 methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::GetSubMenu(THIS)
-{
- WrapLogEnter("CMenuBand<%p>::GetSubMenu()\n", this);
- HRESULT hr = m_IShellMenu2->GetSubMenu();
- WrapLogExit("CMenuBand::GetSubMenu() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::SetToolbar(THIS)
-{
- WrapLogEnter("CMenuBand<%p>::SetToolbar()\n", this);
- HRESULT hr = m_IShellMenu2->SetToolbar();
- WrapLogExit("CMenuBand::SetToolbar() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::SetMinWidth(THIS)
-{
- WrapLogEnter("CMenuBand<%p>::SetMinWidth()\n", this);
- HRESULT hr = m_IShellMenu2->SetMinWidth();
- WrapLogExit("CMenuBand::SetMinWidth() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::SetNoBorder(THIS)
-{
- WrapLogEnter("CMenuBand<%p>::SetNoBorder()\n", this);
- HRESULT hr = m_IShellMenu2->SetNoBorder();
- WrapLogExit("CMenuBand::SetNoBorder() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::SetTheme(THIS)
-{
- WrapLogEnter("CMenuBand<%p>::SetTheme()\n", this);
- HRESULT hr = m_IShellMenu2->SetTheme();
- WrapLogExit("CMenuBand::SetTheme() = %08x\n", hr);
- return hr;
-}
-
-
-// *** IShellMenuAcc methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::GetTop(THIS)
-{
- WrapLogEnter("CMenuBand<%p>::GetTop()\n", this);
- HRESULT hr = m_IShellMenuAcc->GetTop();
- WrapLogExit("CMenuBand::GetTop() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetBottom(THIS)
-{
- WrapLogEnter("CMenuBand<%p>::GetBottom()\n", this);
- HRESULT hr = m_IShellMenuAcc->GetBottom();
- WrapLogExit("CMenuBand::GetBottom() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetTracked(THIS)
-{
- WrapLogEnter("CMenuBand<%p>::GetBottom()\n", this);
- HRESULT hr = m_IShellMenuAcc->GetBottom();
- WrapLogExit("CMenuBand::GetBottom() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetParentSite(THIS)
-{
- WrapLogEnter("CMenuBand<%p>::GetBottom()\n", this);
- HRESULT hr = m_IShellMenuAcc->GetBottom();
- WrapLogExit("CMenuBand::GetBottom() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetState(THIS)
-{
- WrapLogEnter("CMenuBand<%p>::GetBottom()\n", this);
- HRESULT hr = m_IShellMenuAcc->GetBottom();
- WrapLogExit("CMenuBand::GetBottom() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::DoDefaultAction(THIS)
-{
- WrapLogEnter("CMenuBand<%p>::GetBottom()\n", this);
- HRESULT hr = m_IShellMenuAcc->GetBottom();
- WrapLogExit("CMenuBand::GetBottom() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::IsEmpty(THIS)
-{
- WrapLogEnter("CMenuBand<%p>::GetBottom()\n", this);
- HRESULT hr = m_IShellMenuAcc->GetBottom();
- WrapLogExit("CMenuBand::GetBottom() = %08x\n", hr);
- return hr;
-}
-
-// *** IDeskBand methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::GetBandInfo(DWORD dwBandID, DWORD dwViewMode,
DESKBANDINFO *pdbi)
-{
- WrapLogEnter("CMenuBand<%p>::GetBandInfo(DWORD dwBandID=%d, DWORD
dwViewMode=%d, DESKBANDINFO *pdbi=%p)\n", this, dwBandID, dwViewMode, pdbi);
- HRESULT hr = m_IDeskBand->GetBandInfo(dwBandID, dwViewMode, pdbi);
- WrapLogExit("CMenuBand::GetBandInfo() = %08x\n", hr);
- return hr;
-}
-
-// *** IDockingWindow methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::ShowDW(BOOL fShow)
-{
- WrapLogEnter("CMenuBand<%p>::ShowDW(BOOL fShow=%d)\n", this, fShow);
- HRESULT hr = m_IDockingWindow->ShowDW(fShow);
- WrapLogExit("CMenuBand::ShowDW() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::CloseDW(DWORD dwReserved)
-{
- WrapLogEnter("CMenuBand<%p>::CloseDW(DWORD dwReserved=%d)\n", this,
dwReserved);
- HRESULT hr = m_IDockingWindow->CloseDW(dwReserved);
- WrapLogExit("CMenuBand::CloseDW() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::ResizeBorderDW(LPCRECT prcBorder, IUnknown
*punkToolbarSite, BOOL fReserved)
-{
- WrapLogEnter("CMenuBand<%p>::ResizeBorderDW(LPCRECT prcBorder=%p, IUnknown
*punkToolbarSite=%p, BOOL fReserved=%d)\n", this, prcBorder, punkToolbarSite,
fReserved);
- if (prcBorder) WrapLogMsg("*prcBorder=%s\n", Wrap(*prcBorder));
- HRESULT hr = m_IDockingWindow->ResizeBorderDW(prcBorder, punkToolbarSite,
fReserved);
- if (prcBorder) WrapLogMsg("*prcBorder=%s\n", Wrap(*prcBorder));
- WrapLogExit("CMenuBand::ResizeBorderDW() = %08x\n", hr);
- return hr;
-}
-
-// *** IOleWindow methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::GetWindow(HWND *phwnd)
-{
- WrapLogEnter("CMenuBand<%p>::GetWindow(HWND *phwnd=%p)\n", this,
phwnd);
- HRESULT hr = m_IOleWindow->GetWindow(phwnd);
- if (phwnd) WrapLogMsg("*phwnd=%p\n", *phwnd);
- WrapLogExit("CMenuBand::GetWindow() = %08x\n", hr);
- return hr;
-}
-HRESULT STDMETHODCALLTYPE CMenuBand::ContextSensitiveHelp(BOOL fEnterMode)
-{
- WrapLogEnter("CMenuBand<%p>::ContextSensitiveHelp(BOOL
fEnterMode=%d)\n", this, fEnterMode);
- HRESULT hr = m_IOleWindow->ContextSensitiveHelp(fEnterMode);
- WrapLogExit("CMenuBand::ContextSensitiveHelp() = %08x\n", hr);
- return hr;
-}
-
-// *** IWinEventHandler methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam,
LPARAM lParam, LRESULT *theResult)
-{
- //WrapLogEnter("CMenuBand<%p>::OnWinEvent(HWND hWnd=%p, UINT uMsg=%u,
WPARAM wParam=%08x, LPARAM lParam=%08x, LRESULT *theResult=%p)\n", this, hWnd, uMsg,
wParam, lParam, theResult);
- HRESULT hr = m_IWinEventHandler->OnWinEvent(hWnd, uMsg, wParam, lParam,
theResult);
- //WrapLogExit("CMenuBand::OnWinEvent() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::IsWindowOwner(HWND hWnd)
-{
- //WrapLogEnter("CMenuBand<%p>::IsWindowOwner(HWND hWnd=%08x)\n",
this, hWnd);
- HRESULT hr = m_IWinEventHandler->IsWindowOwner(hWnd);
- //WrapLogExit("CMenuBand::IsWindowOwner() = %08x\n", hr);
- return hr;
-}
-
-// *** IObjectWithSite methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::SetSite(IUnknown *pUnkSite)
-{
- WrapLogEnter("CMenuBand<%p>::SetSite(IUnknown *pUnkSite=%p)\n", this,
pUnkSite);
- HRESULT hr = m_IObjectWithSite->SetSite(pUnkSite);
- WrapLogExit("CMenuBand::SetSite() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetSite(REFIID riid, PVOID *ppvSite)
-{
- WrapLogEnter("CMenuBand<%p>::GetSite(REFIID riid=%s, PVOID
*ppvSite=%p)\n", this, Wrap(riid), ppvSite);
- HRESULT hr = m_IObjectWithSite->GetSite(riid, ppvSite);
- if (ppvSite) WrapLogMsg("*ppvSite=%p\n", *ppvSite);
- WrapLogExit("CMenuBand::GetSite() = %08x\n", hr);
- return hr;
-}
-
-// *** IInputObject methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::UIActivateIO(BOOL fActivate, LPMSG lpMsg)
-{
- WrapLogEnter("CMenuBand<%p>::UIActivateIO(BOOL fActivate=%d, LPMSG
lpMsg=%p)\n", this, fActivate, lpMsg);
- HRESULT hr = m_IInputObject->UIActivateIO(fActivate, lpMsg);
- WrapLogExit("CMenuBand::UIActivateIO() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::HasFocusIO()
-{
- WrapLogEnter("CMenuBand<%p>::HasFocusIO()\n", this);
- HRESULT hr = m_IInputObject->HasFocusIO();
- WrapLogExit("CMenuBand::HasFocusIO() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::TranslateAcceleratorIO(LPMSG lpMsg)
-{
- WrapLogEnter("CMenuBand<%p>::TranslateAcceleratorIO(LPMSG
lpMsg=%p)\n", this, lpMsg);
- if (lpMsg) WrapLogMsg("*lpMsg=%s\n", Wrap(*lpMsg));
- HRESULT hr = m_IInputObject->TranslateAcceleratorIO(lpMsg);
- WrapLogExit("CMenuBand::TranslateAcceleratorIO() = %08x\n", hr);
- return hr;
-}
-
-// *** IPersistStream methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::IsDirty()
-{
- WrapLogEnter("CMenuBand<%p>::IsDirty()\n", this);
- HRESULT hr = m_IPersistStream->IsDirty();
- WrapLogExit("CMenuBand::IsDirty() = %08x\n", hr);
- return hr;
-}
-HRESULT STDMETHODCALLTYPE CMenuBand::Load(IStream *pStm)
-{
- WrapLogEnter("CMenuBand<%p>::Load(IStream *pStm=%p)\n", this, pStm);
- HRESULT hr = m_IPersistStream->Load(pStm);
- WrapLogExit("CMenuBand::Load() = %08x\n", hr);
- return hr;
-}
-HRESULT STDMETHODCALLTYPE CMenuBand::Save(IStream *pStm, BOOL fClearDirty)
-{
- WrapLogEnter("CMenuBand<%p>::Save(IStream *pStm=%p, BOOL
fClearDirty=%d)\n", this, pStm, fClearDirty);
- HRESULT hr = m_IPersistStream->Save(pStm, fClearDirty);
- WrapLogExit("CMenuBand::Save() = %08x\n", hr);
- return hr;
-}
-HRESULT STDMETHODCALLTYPE CMenuBand::GetSizeMax(ULARGE_INTEGER *pcbSize)
-{
- WrapLogEnter("CMenuBand<%p>::GetSizeMax(ULARGE_INTEGER
*pcbSize=%p)\n", this, pcbSize);
- HRESULT hr = m_IPersistStream->GetSizeMax(pcbSize);
- WrapLogExit("CMenuBand::GetSizeMax() = %08x\n", hr);
- return hr;
-}
-
-// *** IPersist methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::GetClassID(CLSID *pClassID)
-{
- WrapLogEnter("CMenuBand<%p>::GetClassID(CLSID *pClassID=%p)\n", this,
pClassID);
- HRESULT hr = m_IPersist->GetClassID(pClassID);
- if (pClassID) WrapLogMsg("*pClassID=%s\n", Wrap(*pClassID));
- WrapLogExit("CMenuBand::GetClassID() = %08x\n", hr);
- return hr;
-}
-
-// *** IOleCommandTarget methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds,
OLECMD prgCmds [], OLECMDTEXT *pCmdText)
-{
- WrapLogEnter("CMenuBand<%p>::QueryStatus(const GUID *pguidCmdGroup=%p,
ULONG cCmds=%u, prgCmds=%p, pCmdText=%p)\n", this, pguidCmdGroup, cCmds, prgCmds,
pCmdText);
- HRESULT hr = m_IOleCommandTarget->QueryStatus(pguidCmdGroup, cCmds, prgCmds,
pCmdText);
- if (pguidCmdGroup) WrapLogMsg("*pguidCmdGroup=%s\n",
Wrap(*pguidCmdGroup));
- WrapLogExit("CMenuBand::QueryStatus() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD
nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
-{
- bool b;
-
- WrapLogEnter("CMenuBand<%p>::Exec(const GUID *pguidCmdGroup=%p, DWORD
nCmdID=%d, DWORD nCmdexecopt=%d, VARIANT *pvaIn=%p, VARIANT *pvaOut=%p)\n", this,
pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
-
- if (pguidCmdGroup && IsEqualGUID(*pguidCmdGroup, CLSID_MenuBand))
- {
- if (nCmdID == 19) // popup
- {
- b = true;
- }
- }
-
-
- if (pguidCmdGroup) WrapLogMsg("*pguidCmdGroup=%s\n",
Wrap(*pguidCmdGroup));
- HRESULT hr = m_IOleCommandTarget->Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn,
pvaOut);
- WrapLogExit("CMenuBand::Exec() = %08x\n", hr);
- return hr;
-}
-
-// *** IServiceProvider methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::QueryService(REFGUID guidService, REFIID riid, void
**ppvObject)
-{
- WrapLogEnter("CMenuBand<%p>::QueryService(REFGUID guidService=%s, REFIID
riid=%s, void **ppvObject=%p)\n", this, Wrap(guidService), Wrap(riid), ppvObject);
-
- if (IsEqualIID(guidService, SID_SMenuBandChild))
- {
- WrapLogMsg("SID is SID_SMenuBandChild. Using QueryInterface of self instead
of wrapped object.\n");
- HRESULT hr = this->QueryInterface(riid, ppvObject);
- if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
- if (SUCCEEDED(hr))
- {
- WrapLogExit("CMenuBand::QueryService() = %08x\n", hr);
- return hr;
- }
- else
- {
- WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
- }
- }
- else if (IsEqualIID(guidService, SID_SMenuBandBottom))
- {
- WrapLogMsg("SID is SID_SMenuBandBottom. Using QueryInterface of self instead
of wrapped object.\n");
- HRESULT hr = this->QueryInterface(riid, ppvObject);
- if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
- if (SUCCEEDED(hr))
- {
- WrapLogExit("CMenuBand::QueryService() = %08x\n", hr);
- return hr;
- }
- else
- {
- WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
- }
- }
- else if (IsEqualIID(guidService, SID_SMenuBandBottomSelected))
- {
- WrapLogMsg("SID is SID_SMenuBandBottomSelected. Using QueryInterface of self
instead of wrapped object.\n");
- HRESULT hr = this->QueryInterface(riid, ppvObject);
- if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
- if (SUCCEEDED(hr))
- {
- WrapLogExit("CMenuBand::QueryService() = %08x\n", hr);
- return hr;
- }
- else
- {
- WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
- }
- }
- else
- {
- WrapLogMsg("SID not identified.\n");
- }
- HRESULT hr = m_IServiceProvider->QueryService(guidService, riid, ppvObject);
- if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
- WrapLogExit("CMenuBand::QueryService() = %08x\n", hr);
- return hr;
-}
-
-
-// *** IMenuPopup methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::Popup(POINTL *ppt, RECTL *prcExclude, MP_POPUPFLAGS
dwFlags)
-{
- WrapLogEnter("CMenuBand<%p>::Popup(POINTL *ppt=%p, RECTL *prcExclude=%p,
MP_POPUPFLAGS dwFlags=%08x)\n", this, ppt, prcExclude, dwFlags);
- HRESULT hr = m_IMenuPopup->Popup(ppt, prcExclude, dwFlags);
- WrapLogExit("CMenuBand::Popup() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::OnSelect(DWORD dwSelectType)
-{
- WrapLogEnter("CMenuBand<%p>::OnSelect(DWORD dwSelectType=%08x)\n",
this, dwSelectType);
- HRESULT hr = m_IMenuPopup->OnSelect(dwSelectType);
- WrapLogExit("CMenuBand::OnSelect() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::SetSubMenu(IMenuPopup *pmp, BOOL fSet)
-{
- WrapLogEnter("CMenuBand<%p>::SetSubMenu(IMenuPopup *pmp=%p, BOOL
fSet=%d)\n", this, pmp, fSet);
- HRESULT hr = m_IMenuPopup->SetSubMenu(pmp, fSet);
- WrapLogExit("CMenuBand::SetSubMenu() = %08x\n", hr);
- return hr;
-}
-
-
-// *** IDeskBar methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::SetClient(IUnknown *punkClient)
-{
- WrapLogEnter("CMenuBand<%p>::SetClient(IUnknown *punkClient=%p)\n",
this, punkClient);
- HRESULT hr = m_IDeskBar->SetClient(punkClient);
- WrapLogExit("CMenuBand::SetClient() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetClient(IUnknown **ppunkClient)
-{
- WrapLogEnter("CMenuBand<%p>::GetClient(IUnknown **ppunkClient=%p)\n",
this, ppunkClient);
- HRESULT hr = m_IDeskBar->GetClient(ppunkClient);
- if (ppunkClient) WrapLogMsg("*ppunkClient=%p\n", *ppunkClient);
- WrapLogExit("CMenuBand::GetClient() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::OnPosRectChangeDB(RECT *prc)
-{
- WrapLogEnter("CMenuBand<%p>::OnPosRectChangeDB(RECT *prc=%p)\n",
this, prc);
- HRESULT hr = m_IDeskBar->OnPosRectChangeDB(prc);
- if (prc) WrapLogMsg("*prc=%s\n", Wrap(*prc));
- WrapLogExit("CMenuBand::OnPosRectChangeDB() = %08x\n", hr);
- return hr;
-}
-
-
-// *** IMenuBand methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::IsMenuMessage(MSG *pmsg)
-{
- //WrapLogEnter("CMenuBand<%p>::IsMenuMessage(MSG *pmsg=%p)\n", this,
pmsg);
- HRESULT hr = m_IMenuBand->IsMenuMessage(pmsg);
- //WrapLogExit("CMenuBand::IsMenuMessage() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::TranslateMenuMessage(MSG *pmsg, LRESULT *plRet)
-{
- //WrapLogEnter("CMenuBand<%p>::TranslateMenuMessage(MSG *pmsg=%p, LRESULT
*plRet=%p)\n", this, pmsg, plRet);
- HRESULT hr = m_IMenuBand->TranslateMenuMessage(pmsg, plRet);
- //WrapLogExit("CMenuBand::TranslateMenuMessage(*plRet=%d) = %08x\n",
*plRet, hr);
- return hr;
-}
-
-// *** IShellMenu methods ***
-HRESULT STDMETHODCALLTYPE CMenuBand::Initialize(IShellMenuCallback *psmc, UINT uId, UINT
uIdAncestor, DWORD dwFlags)
-{
- WrapLogEnter("CMenuBand<%p>::Initialize(IShellMenuCallback *psmc=%p, UINT
uId=%u, UINT uIdAncestor=%u, DWORD dwFlags=%08x)\n", this, psmc, uId, uIdAncestor,
dwFlags);
- HRESULT hr = m_IShellMenu->Initialize(psmc, uId, uIdAncestor, dwFlags);
- WrapLogExit("CMenuBand::Initialize() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetMenuInfo(IShellMenuCallback **ppsmc, UINT *puId,
UINT *puIdAncestor, DWORD *pdwFlags)
-{
- WrapLogEnter("CMenuBand<%p>::GetMenuInfo(IShellMenuCallback **ppsmc=%p,
UINT *puId=%p, UINT *puIdAncestor=%p, DWORD *pdwFlags=%p)\n", this, ppsmc, puId,
puIdAncestor, pdwFlags);
- HRESULT hr = m_IShellMenu->GetMenuInfo(ppsmc, puId, puIdAncestor, pdwFlags);
- if (ppsmc) WrapLogMsg("*ppsmc=%p\n", *ppsmc);
- if (puId) WrapLogMsg("*puId=%u\n", *puId);
- if (puIdAncestor) WrapLogMsg("*puIdAncestor=%u\n", *puIdAncestor);
- if (pdwFlags) WrapLogMsg("*pdwFlags=%08x\n", *pdwFlags);
- WrapLogExit("CMenuBand::GetMenuInfo() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::SetShellFolder(IShellFolder *psf, LPCITEMIDLIST
pidlFolder, HKEY hKey, DWORD dwFlags)
-{
- WrapLogEnter("CMenuBand<%p>::SetShellFolder(IShellFolder *psf=%p,
LPCITEMIDLIST pidlFolder=%p, HKEY hKey=%p, DWORD dwFlags=%08x)\n", this, psf,
pidlFolder, hKey, dwFlags);
- HRESULT hr = m_IShellMenu->SetShellFolder(psf, pidlFolder, hKey, dwFlags);
- WrapLogExit("CMenuBand::SetShellFolder() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetShellFolder(DWORD *pdwFlags, LPITEMIDLIST *ppidl,
REFIID riid, void **ppv)
-{
- WrapLogEnter("CMenuBand<%p>::GetShellFolder(DWORD *pdwFlags=%p,
LPITEMIDLIST *ppidl=%p, REFIID riid=%s, void **ppv=%p)\n", this, pdwFlags, ppidl,
Wrap(riid), ppv);
- HRESULT hr = m_IShellMenu->GetShellFolder(pdwFlags, ppidl, riid, ppv);
- if (pdwFlags) WrapLogMsg("*pdwFlags=%08x\n", *pdwFlags);
- if (ppidl) WrapLogMsg("*ppidl=%p\n", *ppidl);
- if (ppv) WrapLogMsg("*ppv=%p\n", *ppv);
- WrapLogExit("CMenuBand::GetShellFolder() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::SetMenu(HMENU hmenu, HWND hwnd, DWORD dwFlags)
-{
- WrapLogEnter("CMenuBand<%p>::SetMenu(HMENU hmenu=%p, HWND hwnd=%p, DWORD
dwFlags=%08x)\n", this, hmenu, hwnd, dwFlags);
- HRESULT hr = m_IShellMenu->SetMenu(hmenu, hwnd, dwFlags);
- WrapLogExit("CMenuBand::SetMenu() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetMenu(HMENU *phmenu, HWND *phwnd, DWORD
*pdwFlags)
-{
- WrapLogEnter("CMenuBand<%p>::GetMenu(HMENU *phmenu=%p, HWND *phwnd=%p,
DWORD *pdwFlags=%p)\n", this, phmenu, phwnd, pdwFlags);
- HRESULT hr = m_IShellMenu->GetMenu(phmenu, phwnd, pdwFlags);
- if (phmenu) WrapLogMsg("*phmenu=%p\n", *phmenu);
- if (phwnd) WrapLogMsg("*phwnd=%p\n", *phwnd);
- if (pdwFlags) WrapLogMsg("*pdwFlags=%08x\n", *pdwFlags);
- WrapLogExit("CMenuBand::GetMenu() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::InvalidateItem(LPSMDATA psmd, DWORD dwFlags)
-{
- WrapLogEnter("CMenuBand<%p>::InvalidateItem(LPSMDATA psmd=%p, DWORD
dwFlags=%08x)\n", this, psmd, dwFlags);
- HRESULT hr = m_IShellMenu->InvalidateItem(psmd, dwFlags);
- WrapLogExit("CMenuBand::InvalidateItem() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::GetState(LPSMDATA psmd)
-{
- WrapLogEnter("CMenuBand<%p>::GetState(LPSMDATA psmd=%p)\n", this,
psmd);
- HRESULT hr = m_IShellMenu->GetState(psmd);
- WrapLogExit("CMenuBand::GetState() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuBand::SetMenuToolbar(IUnknown *punk, DWORD dwFlags)
-{
- WrapLogEnter("CMenuBand<%p>::SetMenuToolbar(IUnknown *punk=%p, DWORD
dwFlags=%08x)\n", this, punk, dwFlags);
- HRESULT hr = m_IShellMenu->SetMenuToolbar(punk, dwFlags);
- WrapLogExit("CMenuBand::SetMenuToolbar() = %08x\n", hr);
- return hr;
-}
-#else
-
CMenuToolbarBase::CMenuToolbarBase(CMenuBand *menuBand) :
m_menuBand(menuBand),
m_hwnd(NULL),
@@ -991,7 +419,7 @@
{
if (HasSubMenu(hot->idNew) == S_OK)
{
- DWORD elapsed;
+ DWORD elapsed = 0;
SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &elapsed, 0);
m_hotItem = hot->idNew;
@@ -1009,9 +437,9 @@
IBandSite* pBandSite;
IDeskBar* pDeskBar;
- HRESULT hr;
-
- RECT rc;
+ HRESULT hr = 0;
+ RECT rc = { 0 };
+
if (!SendMessage(m_hwnd, TB_GETITEMRECT, index,
reinterpret_cast<LPARAM>(&rc)))
return E_FAIL;
@@ -1025,7 +453,7 @@
RECTL rcl = { a.x, a.y, b.x, b.y }; // maybe-TODO: fetch client area of deskbar?
-#ifndef USE_BUILTIN_MENUSITE
+#if USE_SYSTEM_MENUSITE
hr = CoCreateInstance(CLSID_MenuBandSite,
NULL,
CLSCTX_INPROC_SERVER,
@@ -1036,11 +464,13 @@
if (FAILED(hr))
return hr;
-#ifndef USE_BUILTIN_MENUDESKBAR
+#if USE_SYSTEM_MENUDESKBAR
hr = CoCreateInstance(CLSID_MenuDeskBar,
NULL,
CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IDeskBar, &pDeskBar));
+#elif WRAP_MENUDESKBAR
+ hr = CMenuDeskBar_Wrapper(IID_PPV_ARG(IDeskBar, &pDeskBar));
#else
hr = CMenuDeskBar_Constructor(IID_PPV_ARG(IDeskBar, &pDeskBar));
#endif
@@ -1067,21 +497,18 @@
HRESULT CMenuToolbarBase::PopupSubMenu(UINT index, HMENU menu)
{
- RECT rc;
+ RECT rc = { 0 };
+
if (!SendMessage(m_hwnd, TB_GETITEMRECT, index,
reinterpret_cast<LPARAM>(&rc)))
return E_FAIL;
- POINT a = { rc.left, rc.top };
POINT b = { rc.right, rc.bottom };
- ClientToScreen(m_hwnd, &a);
ClientToScreen(m_hwnd, &b);
- SetRect(&rc, a.x, a.y, b.x, b.y); // maybe-TODO: fetch client area of deskbar?
-
HMENU popup = GetSubMenu(menu, index);
- m_menuBand->TrackPopup(popup, rc.right, rc.bottom, rc);
+ m_menuBand->TrackPopup(popup, b.x, b.y);
return S_OK;
}
@@ -1200,7 +627,7 @@
SMINFO * sminfo = new SMINFO();
sminfo->dwMask = SMIM_ICON | SMIM_FLAGS;
- if (info.wID >= 0 &&
SUCCEEDED(m_menuBand->CallCBWithId(info.wID, SMC_GETINFO, 0,
reinterpret_cast<LPARAM>(sminfo))))
+ if (SUCCEEDED(m_menuBand->CallCBWithId(info.wID, SMC_GETINFO, 0,
reinterpret_cast<LPARAM>(sminfo))))
{
tbb.iBitmap = sminfo->iIcon;
tbb.dwData = reinterpret_cast<DWORD_PTR>(sminfo);
@@ -1253,6 +680,9 @@
SendMessage(m_hwnd, TB_GETBUTTON, index, reinterpret_cast<LPARAM>(&btn));
SMINFO * nfo = reinterpret_cast<SMINFO*>(btn.dwData);
+ if (!nfo)
+ return E_FAIL;
+
if (nfo->dwFlags&SMIF_TRACKPOPUP)
{
return PopupSubMenu(index, m_hmenu);
@@ -1433,11 +863,13 @@
if (!pidl)
return E_FAIL;
-#ifndef USE_BUILTIN_MENUBAND
+#if USE_SYSTEM_MENUBAND
hr = CoCreateInstance(CLSID_MenuBand,
NULL,
CLSCTX_INPROC_SERVER,
- IID_PPV_ARG(IShellMenu, &pShellMenu));
+ IID_PPV_ARG(IShellMenu, &shellMenu));
+#elif WRAP_MENUBAND
+ hr = CMenuBand_Wrapper(IID_PPV_ARG(IShellMenu, &shellMenu));
#else
hr = CMenuBand_Constructor(IID_PPV_ARG(IShellMenu, &shellMenu));
#endif
@@ -1471,6 +903,8 @@
SFGAOF attrs;
hr = psi->GetAttributes(SFGAO_FOLDER, &attrs);
+ if (FAILED(hr))
+ return hr;
return (attrs != 0) ? S_OK : S_FALSE;
}
@@ -2236,9 +1670,8 @@
return hr;
}
-HRESULT CMenuBand::TrackPopup(HMENU popup, INT x, INT y, RECT& rc)
-{
- ::TrackPopupMenu(popup, 0, x, y, 0, m_menuOwner, &rc);
- return S_OK;
-}
-#endif
+HRESULT CMenuBand::TrackPopup(HMENU popup, INT x, INT y)
+{
+ ::TrackPopupMenu(popup, 0, x, y, 0, m_menuOwner, NULL);
+ return S_OK;
+}
Modified: branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp [iso-8859-1] Wed Feb 19
00:20:45 2014
@@ -18,13 +18,10 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "precomp.h"
-#include "wraplog.h"
#include <atlwin.h>
#include <shlwapi_undoc.h>
WINE_DEFAULT_DEBUG_CHANNEL(CMenuDeskBar);
-
-#define WRAP_LOG 0
typedef CWinTraits<
WS_POPUP | WS_DLGFRAME | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
@@ -32,9 +29,7 @@
CMenuWinTraits;
class CMenuDeskBar :
-#if !WRAP_LOG
public CWindowImpl<CMenuDeskBar, CWindow, CMenuWinTraits>,
-#endif
public CComCoClass<CMenuDeskBar>,
public CComObjectRootEx<CComMultiThreadModelNoCS>,
public IOleCommandTarget,
@@ -51,28 +46,12 @@
~CMenuDeskBar();
private:
-#if WRAP_LOG
- IUnknown * m_IUnknown;
- IMenuPopup * m_IMenuPopup;
- IOleCommandTarget * m_IOleCommandTarget;
- IServiceProvider * m_IServiceProvider;
- IDeskBar * m_IDeskBar;
- IOleWindow * m_IOleWindow;
- IInputObjectSite * m_IInputObjectSite;
- IInputObject * m_IInputObject;
- IObjectWithSite * m_IObjectWithSite;
- IBanneredBar * m_IBanneredBar;
- IInitializeObject * m_IInitializeObject;
-#else
-
CComPtr<IUnknown> m_Site;
CComPtr<IUnknown> m_Client;
CComPtr<IMenuPopup> m_SubMenuParent;
DWORD m_IconSize;
HBITMAP m_Banner;
-
-#endif
public:
// *** IMenuPopup methods ***
@@ -120,7 +99,6 @@
DECLARE_NOT_AGGREGATABLE(CMenuDeskBar)
DECLARE_PROTECT_FINAL_CONSTRUCT()
-#if !WRAP_LOG
DECLARE_WND_CLASS_EX(_T("BaseBar"), CS_SAVEBITS | CS_DROPSHADOW,
COLOR_3DFACE)
BEGIN_MSG_MAP(CMenuDeskBar)
@@ -129,14 +107,6 @@
MESSAGE_HANDLER(WM_WINDOWPOSCHANGED, OnWindowPosChanged)
MESSAGE_HANDLER(WM_PAINT, OnPaint)
END_MSG_MAP()
-
- // message handlers
- LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
- LRESULT OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
- LRESULT OnWindowPosChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled);
- LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
-
-#endif
BEGIN_COM_MAP(CMenuDeskBar)
COM_INTERFACE_ENTRY_IID(IID_IMenuPopup, IMenuPopup)
@@ -150,6 +120,14 @@
COM_INTERFACE_ENTRY_IID(IID_IBanneredBar, IBanneredBar)
COM_INTERFACE_ENTRY_IID(IID_IInitializeObject, IInitializeObject)
END_COM_MAP()
+
+private:
+
+ // message handlers
+ LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
+ LRESULT OnNotify(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
+ LRESULT OnWindowPosChanged(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled);
+ LRESULT OnPaint(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
};
extern "C"
@@ -169,296 +147,6 @@
return hr;
}
-
-#if WRAP_LOG
-CMenuDeskBar::CMenuDeskBar()
-{
- HRESULT hr;
- WrapLogOpen();
-
- hr = CoCreateInstance(CLSID_MenuDeskBar, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IMenuPopup, &m_IMenuPopup));
- hr = m_IMenuPopup->QueryInterface(IID_PPV_ARG(IUnknown, &m_IUnknown));
-
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IOleCommandTarget,
&m_IOleCommandTarget));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IServiceProvider,
&m_IServiceProvider));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IDeskBar, &m_IDeskBar));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IOleWindow, &m_IOleWindow));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IInputObjectSite,
&m_IInputObjectSite));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IInputObject, &m_IInputObject));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IObjectWithSite,
&m_IObjectWithSite));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IBanneredBar, &m_IBanneredBar));
- hr = m_IUnknown->QueryInterface(IID_PPV_ARG(IInitializeObject,
&m_IInitializeObject));
-}
-
-CMenuDeskBar::~CMenuDeskBar()
-{
- m_IUnknown->Release();
- m_IMenuPopup->Release();
- m_IOleCommandTarget->Release();
- m_IServiceProvider->Release();
- m_IDeskBar->Release();
- m_IOleWindow->Release();
- m_IInputObjectSite->Release();
- m_IInputObject->Release();
- m_IObjectWithSite->Release();
- m_IBanneredBar->Release();
- m_IInitializeObject->Release();
-
- WrapLogClose();
-}
-
-// *** IMenuPopup methods ***
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::Popup(POINTL *ppt, RECTL *prcExclude,
MP_POPUPFLAGS dwFlags)
-{
- WrapLogEnter("CMenuDeskBar<%p>::Popup(POINTL *ppt=%p, RECTL
*prcExclude=%p, MP_POPUPFLAGS dwFlags=%08x)\n", this, ppt, prcExclude, dwFlags);
- HRESULT hr = m_IMenuPopup->Popup(ppt, prcExclude, dwFlags);
- WrapLogExit("CMenuDeskBar::Popup() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnSelect(DWORD dwSelectType)
-{
- WrapLogEnter("CMenuDeskBar<%p>::OnSelect(DWORD dwSelectType=%08x)\n",
this, dwSelectType);
- HRESULT hr = m_IMenuPopup->OnSelect(dwSelectType);
- WrapLogExit("CMenuDeskBar::OnSelect() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetSubMenu(IMenuPopup *pmp, BOOL fSet)
-{
- WrapLogEnter("CMenuDeskBar<%p>::SetSubMenu(IMenuPopup *pmp=%p, BOOL
fSet=%d)\n", this, pmp, fSet);
- HRESULT hr = m_IMenuPopup->SetSubMenu(pmp, fSet);
- WrapLogExit("CMenuDeskBar::SetSubMenu() = %08x\n", hr);
- return hr;
-}
-
-// *** IOleWindow methods ***
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetWindow(HWND *phwnd)
-{
- WrapLogEnter("CMenuDeskBar<%p>::GetWindow(HWND *phwnd=%p)\n", this,
phwnd);
- HRESULT hr = m_IOleWindow->GetWindow(phwnd);
- if (phwnd) WrapLogMsg("*phwnd=%p\n", *phwnd);
- WrapLogExit("CMenuDeskBar::GetWindow() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::ContextSensitiveHelp(BOOL fEnterMode)
-{
- WrapLogEnter("CMenuDeskBar<%p>::ContextSensitiveHelp(BOOL
fEnterMode=%d)\n", this, fEnterMode);
- HRESULT hr = m_IOleWindow->ContextSensitiveHelp(fEnterMode);
- WrapLogExit("CMenuDeskBar::ContextSensitiveHelp() = %08x\n", hr);
- return hr;
-}
-
-// *** IObjectWithSite methods ***
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetSite(IUnknown *pUnkSite)
-{
- WrapLogEnter("CMenuDeskBar<%p>::SetSite(IUnknown *pUnkSite=%p)\n",
this, pUnkSite);
- HRESULT hr = m_IObjectWithSite->SetSite(pUnkSite);
- WrapLogExit("CMenuDeskBar::SetSite() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetSite(REFIID riid, PVOID *ppvSite)
-{
- WrapLogEnter("CMenuDeskBar<%p>::GetSite(REFIID riid=%s, PVOID
*ppvSite=%p)\n", this, Wrap(riid), ppvSite);
- HRESULT hr = m_IObjectWithSite->GetSite(riid, ppvSite);
- if (ppvSite) WrapLogMsg("*ppvSite=%p\n", *ppvSite);
- WrapLogExit("CMenuDeskBar::GetSite() = %08x\n", hr);
- return hr;
-}
-
-// *** IBanneredBar methods ***
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetIconSize(DWORD iIcon)
-{
- WrapLogEnter("CMenuDeskBar<%p>::SetIconSize(DWORD iIcon=%d)\n", this,
iIcon);
- HRESULT hr = m_IBanneredBar->SetIconSize(iIcon);
- WrapLogExit("CMenuDeskBar::SetIconSize() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetIconSize(DWORD* piIcon)
-{
- WrapLogEnter("CMenuDeskBar<%p>::GetIconSize(DWORD* piIcon=%p)\n",
this, piIcon);
- HRESULT hr = m_IBanneredBar->GetIconSize(piIcon);
- if (piIcon) WrapLogMsg("*piIcon=%d\n", *piIcon);
- WrapLogExit("CMenuDeskBar::GetIconSize() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetBitmap(HBITMAP hBitmap)
-{
- WrapLogEnter("CMenuDeskBar<%p>::SetBitmap(HBITMAP hBitmap=%p)\n",
this, hBitmap);
- HRESULT hr = m_IBanneredBar->SetBitmap(hBitmap);
- WrapLogExit("CMenuDeskBar::SetBitmap() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetBitmap(HBITMAP* phBitmap)
-{
- WrapLogEnter("CMenuDeskBar<%p>::GetBitmap(HBITMAP* phBitmap=%p)\n",
this, phBitmap);
- HRESULT hr = m_IBanneredBar->GetBitmap(phBitmap);
- if (phBitmap) WrapLogMsg("*phBitmap=%p\n", *phBitmap);
- WrapLogExit("CMenuDeskBar::GetBitmap() = %08x\n", hr);
- return hr;
-}
-
-
-// *** IInitializeObject methods ***
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::Initialize(THIS)
-{
- WrapLogEnter("CMenuDeskBar<%p>::Initialize()\n", this);
- HRESULT hr = m_IInitializeObject->Initialize();
- WrapLogExit("CMenuDeskBar::Initialize() = %08x\n", hr);
- return hr;
-}
-
-// *** IOleCommandTarget methods ***
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::QueryStatus(const GUID *pguidCmdGroup, ULONG
cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
-{
- WrapLogEnter("CMenuDeskBar<%p>::QueryStatus(const GUID *pguidCmdGroup=%p,
ULONG cCmds=%u, prgCmds=%p, pCmdText=%p)\n", this, pguidCmdGroup, cCmds, prgCmds,
pCmdText);
- HRESULT hr = m_IOleCommandTarget->QueryStatus(pguidCmdGroup, cCmds, prgCmds,
pCmdText);
- if (pguidCmdGroup) WrapLogMsg("*pguidCmdGroup=%s\n",
Wrap(*pguidCmdGroup));
- WrapLogExit("CMenuDeskBar::QueryStatus() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::Exec(const GUID *pguidCmdGroup, DWORD nCmdID,
DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
-{
- WrapLogEnter("CMenuDeskBar<%p>::Exec(const GUID *pguidCmdGroup=%p, DWORD
nCmdID=%d, DWORD nCmdexecopt=%d, VARIANT *pvaIn=%p, VARIANT *pvaOut=%p)\n", this,
pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
- if (pguidCmdGroup) WrapLogMsg("*pguidCmdGroup=%s\n",
Wrap(*pguidCmdGroup));
- HRESULT hr = m_IOleCommandTarget->Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn,
pvaOut);
- WrapLogExit("CMenuDeskBar::Exec() = %08x\n", hr);
- return hr;
-}
-
-// *** IServiceProvider methods ***
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::QueryService(REFGUID guidService, REFIID riid,
void **ppvObject)
-{
- WrapLogEnter("CMenuDeskBar<%p>::QueryService(REFGUID guidService=%s,
REFIID riid=%s, void **ppvObject=%p)\n", this, Wrap(guidService), Wrap(riid),
ppvObject);
-
- if (IsEqualIID(guidService, SID_SMenuPopup))
- {
- WrapLogMsg("SID is SID_SMenuPopup. Using QueryInterface of self instead of
wrapped object.\n");
- HRESULT hr = this->QueryInterface(riid, ppvObject);
- if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
- if (SUCCEEDED(hr))
- {
- WrapLogExit("CMenuDeskBar::QueryService() = %08x\n", hr);
- return hr;
- }
- else
- {
- WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
- }
- }
- else if (IsEqualIID(guidService, SID_SMenuBandParent))
- {
- WrapLogMsg("SID is SID_SMenuBandParent. Using QueryInterface of self instead
of wrapped object.\n");
- HRESULT hr = this->QueryInterface(riid, ppvObject);
- if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
- if (SUCCEEDED(hr))
- {
- WrapLogExit("CMenuDeskBar::QueryService() = %08x\n", hr);
- return hr;
- }
- else
- {
- WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
- }
- }
- else if (IsEqualIID(guidService, SID_STopLevelBrowser))
- {
- WrapLogMsg("SID is SID_STopLevelBrowser. Using QueryInterface of self
instead of wrapped object.\n");
- HRESULT hr = this->QueryInterface(riid, ppvObject);
- if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
- if (SUCCEEDED(hr))
- {
- WrapLogExit("CMenuDeskBar::QueryService() = %08x\n", hr);
- return hr;
- }
- else
- {
- WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
- }
- }
- else
- {
- WrapLogMsg("SID not identified. Calling wrapped object's
QueryService.\n");
- }
- HRESULT hr = m_IServiceProvider->QueryService(guidService, riid, ppvObject);
- if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
- WrapLogExit("CMenuDeskBar::QueryService() = %08x\n", hr);
- return hr;
-}
-
-// *** IInputObjectSite methods ***
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnFocusChangeIS(LPUNKNOWN lpUnknown, BOOL
bFocus)
-{
- WrapLogEnter("CMenuDeskBar<%p>::OnFocusChangeIS(LPUNKNOWN lpUnknown=%p,
BOOL bFocus=%d)\n", this, lpUnknown, bFocus);
- HRESULT hr = m_IInputObjectSite->OnFocusChangeIS(lpUnknown, bFocus);
- WrapLogExit("CMenuDeskBar::OnFocusChangeIS() = %08x\n", hr);
- return hr;
-}
-
-// *** IInputObject methods ***
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::UIActivateIO(BOOL bActivating, LPMSG lpMsg)
-{
- WrapLogEnter("CMenuDeskBar<%p>::UIActivateIO(BOOL bActivating=%d, LPMSG
lpMsg=%p)\n", this, bActivating, lpMsg);
- HRESULT hr = m_IInputObject->UIActivateIO(bActivating, lpMsg);
- WrapLogExit("CMenuDeskBar::UIActivateIO() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::HasFocusIO(THIS)
-{
- WrapLogEnter("CMenuDeskBar<%p>::HasFocusIO()\n", this);
- HRESULT hr = m_IInputObject->HasFocusIO();
- WrapLogExit("CMenuDeskBar::HasFocusIO() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::TranslateAcceleratorIO(LPMSG lpMsg)
-{
- WrapLogEnter("CMenuDeskBar<%p>::TranslateAcceleratorIO(LPMSG
lpMsg=%p)\n", this, lpMsg);
- if (lpMsg) WrapLogMsg("*lpMsg=%s\n", Wrap(*lpMsg));
- HRESULT hr = m_IInputObject->TranslateAcceleratorIO(lpMsg);
- WrapLogExit("CMenuDeskBar::TranslateAcceleratorIO() = %08x\n", hr);
- return hr;
-}
-
-// *** IDeskBar methods ***
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::SetClient(IUnknown *punkClient)
-{
- WrapLogEnter("CMenuDeskBar<%p>::SetClient(IUnknown
*punkClient=%p)\n", this, punkClient);
- HRESULT hr = m_IDeskBar->SetClient(punkClient);
- WrapLogExit("CMenuDeskBar::SetClient() = %08x\n", hr);
-
- CComPtr<IDeskBarClient> dbc;
- punkClient->QueryInterface(IID_PPV_ARG(IDeskBarClient, &dbc));
- dbc->SetDeskBarSite(static_cast<IDeskBar*>(this));
-
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::GetClient(IUnknown **ppunkClient)
-{
- WrapLogEnter("CMenuDeskBar<%p>::GetClient(IUnknown
**ppunkClient=%p)\n", this, ppunkClient);
- HRESULT hr = m_IDeskBar->GetClient(ppunkClient);
- if (ppunkClient) WrapLogMsg("*ppunkClient=%p\n", *ppunkClient);
- WrapLogExit("CMenuDeskBar::GetClient() = %08x\n", hr);
- return hr;
-}
-
-HRESULT STDMETHODCALLTYPE CMenuDeskBar::OnPosRectChangeDB(LPRECT prc)
-{
- WrapLogEnter("CMenuDeskBar<%p>::OnPosRectChangeDB(RECT *prc=%p)\n",
this, prc);
- HRESULT hr = m_IDeskBar->OnPosRectChangeDB(prc);
- if (prc) WrapLogMsg("*prc=%s\n", Wrap(*prc));
- WrapLogExit("CMenuDeskBar::OnPosRectChangeDB() = %08x\n", hr);
- return hr;
-}
-#else
CMenuDeskBar::CMenuDeskBar() :
m_Client(NULL),
@@ -699,7 +387,6 @@
const int bx = bm.bmWidth;
const int by = bm.bmHeight;
- const int cx = rc.right;
const int cy = rc.bottom;
TRACE("Painting banner: %d by %d\n", bm.bmWidth, bm.bmHeight);
@@ -915,5 +602,3 @@
{
return S_OK;
}
-
-#endif
Modified: branches/shell-experiments/base/shell/rshell/CStartMenu.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CStartMenu.cpp [iso-8859-1] Wed Feb 19
00:20:45 2014
@@ -17,10 +17,10 @@
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include "precomp.h"
//#define TEST_TRACKPOPUPMENU_SUBMENUS
-#include "precomp.h"
/* NOTE: The following constants *MUST NOT* be changed because
they're hardcoded and need to be the exact values
@@ -136,7 +136,7 @@
case IDM_DOCUMENTS: csidl = CSIDL_RECENT; break;
}
-#ifndef USE_BUILTIN_MENUBAND
+#if USE_SYSTEM_MENUBAND
hr = CoCreateInstance(CLSID_MenuBand,
NULL,
CLSCTX_INPROC_SERVER,
@@ -271,18 +271,20 @@
IShellFolder *shellFolder;
IShellFolder *psfStartMenu;
-#ifndef USE_BUILTIN_MENUBAND
+#if USE_SYSTEM_MENUBAND
hr = CoCreateInstance(CLSID_MenuBand,
NULL,
CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IShellMenu, &pShellMenu));
+#elif WRAP_MENUBAND
+ hr = CMenuBand_Wrapper(IID_PPV_ARG(IShellMenu, &pShellMenu));
#else
hr = CMenuBand_Constructor(IID_PPV_ARG(IShellMenu, &pShellMenu));
#endif
if (FAILED(hr))
return hr;
-#ifndef USE_BUILTIN_MENUSITE
+#if USE_SYSTEM_MENUSITE
hr = CoCreateInstance(CLSID_MenuBandSite,
NULL,
CLSCTX_INPROC_SERVER,
@@ -293,11 +295,13 @@
if (FAILED(hr))
return hr;
-#ifndef USE_BUILTIN_MENUDESKBAR
+#if USE_SYSTEM_MENUDESKBAR
hr = CoCreateInstance(CLSID_MenuDeskBar,
NULL,
CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IDeskBar, &pDeskBar));
+#elif WRAP_MENUDESKBAR
+ hr = CMenuDeskBar_Wrapper(IID_PPV_ARG(IDeskBar, &pDeskBar));
#else
hr = CMenuDeskBar_Constructor(IID_PPV_ARG(IDeskBar, &pDeskBar));
#endif
@@ -311,7 +315,7 @@
pCallback->AddRef(); // CreateInstance returns object with 0 ref count */
pCallback->Initialize(pShellMenu, pBandSite, pDeskBar);
- pShellMenu->Initialize(pCallback, -1, 0, SMINIT_TOPLEVEL | SMINIT_VERTICAL);
+ pShellMenu->Initialize(pCallback, (UINT)-1, 0, SMINIT_TOPLEVEL |
SMINIT_VERTICAL);
if (FAILED(hr))
return hr;
Propchange: branches/shell-experiments/base/shell/rshell/logging/
------------------------------------------------------------------------------
--- bugtraq:logregex (added)
+++ bugtraq:logregex Wed Feb 19 00:20:45 2014
@@ -0,0 +1,2 @@
+([Ii]ssue|[Bb]ug)s? #?(\d+)(,? ?#?(\d+))*(,? ?(and |or )?#?(\d+))?
+(\d+)
Propchange: branches/shell-experiments/base/shell/rshell/logging/
------------------------------------------------------------------------------
bugtraq:message = See issue #%BUGID% for more details.
Propchange: branches/shell-experiments/base/shell/rshell/logging/
------------------------------------------------------------------------------
bugtraq:url =
http://www.reactos.org/bugzilla/show_bug.cgi?id=%BUGID%
Propchange: branches/shell-experiments/base/shell/rshell/logging/
------------------------------------------------------------------------------
tsvn:logminsize = 10
Added: branches/shell-experiments/base/shell/rshell/logging/CMenuBandWrap.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/logging/CMenuBandWrap.cpp (added)
+++ branches/shell-experiments/base/shell/rshell/logging/CMenuBandWrap.cpp [iso-8859-1]
Wed Feb 19 00:20:45 2014
@@ -0,0 +1,721 @@
+/*
+* Shell Menu Band
+*
+* Copyright 2014 David Quintana
+*
+* 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
+*/
+#include "precomp.h"
+#include "wraplog.h"
+
+WINE_DEFAULT_DEBUG_CHANNEL(CMenuBandWrap);
+
+class CMenuBandWrap :
+ public CComCoClass<CMenuBandWrap>,
+ public CComObjectRootEx<CComMultiThreadModelNoCS>,
+ public IDeskBand,
+ public IObjectWithSite,
+ public IInputObject,
+ public IPersistStream,
+ public IOleCommandTarget,
+ public IServiceProvider,
+ public IMenuPopup,
+ public IMenuBand,
+ public IShellMenu2,
+ public IWinEventHandler,
+ public IShellMenuAcc
+{
+public:
+ CMenuBandWrap();
+ ~CMenuBandWrap();
+
+private:
+ IUnknown * m_IUnknown;
+ IDeskBand * m_IDeskBand;
+ IDockingWindow * m_IDockingWindow;
+ IOleWindow * m_IOleWindow;
+ IObjectWithSite * m_IObjectWithSite;
+ IInputObject * m_IInputObject;
+ IPersistStream * m_IPersistStream;
+ IPersist * m_IPersist;
+ IOleCommandTarget * m_IOleCommandTarget;
+ IServiceProvider * m_IServiceProvider;
+ IMenuPopup * m_IMenuPopup;
+ IDeskBar * m_IDeskBar;
+ IMenuBand * m_IMenuBand;
+ IShellMenu2 * m_IShellMenu2;
+ IShellMenu * m_IShellMenu;
+ IWinEventHandler * m_IWinEventHandler;
+ IShellMenuAcc * m_IShellMenuAcc;
+
+ BOOL m_useBigIcons;
+
+public:
+
+ // *** IDeskBand methods ***
+ virtual HRESULT STDMETHODCALLTYPE GetBandInfo(DWORD dwBandID, DWORD dwViewMode,
DESKBANDINFO *pdbi);
+
+ // *** IDockingWindow methods ***
+ virtual HRESULT STDMETHODCALLTYPE ShowDW(BOOL fShow);
+ virtual HRESULT STDMETHODCALLTYPE CloseDW(DWORD dwReserved);
+ virtual HRESULT STDMETHODCALLTYPE ResizeBorderDW(LPCRECT prcBorder, IUnknown
*punkToolbarSite, BOOL fReserved);
+
+ // *** IOleWindow methods ***
+ virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *phwnd);
+ virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
+
+ // *** IObjectWithSite methods ***
+ virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite);
+ virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, PVOID *ppvSite);
+
+ // *** IInputObject methods ***
+ virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL fActivate, LPMSG lpMsg);
+ virtual HRESULT STDMETHODCALLTYPE HasFocusIO();
+ virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO(LPMSG lpMsg);
+
+ // *** IPersistStream methods ***
+ virtual HRESULT STDMETHODCALLTYPE IsDirty();
+ virtual HRESULT STDMETHODCALLTYPE Load(IStream *pStm);
+ virtual HRESULT STDMETHODCALLTYPE Save(IStream *pStm, BOOL fClearDirty);
+ virtual HRESULT STDMETHODCALLTYPE GetSizeMax(ULARGE_INTEGER *pcbSize);
+
+ // *** IPersist methods ***
+ virtual HRESULT STDMETHODCALLTYPE GetClassID(CLSID *pClassID);
+
+ // *** IOleCommandTarget methods ***
+ virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds,
OLECMD prgCmds [], OLECMDTEXT *pCmdText);
+ virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD
nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut);
+
+ // *** IServiceProvider methods ***
+ virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void
**ppvObject);
+
+ // *** IMenuPopup methods ***
+ virtual HRESULT STDMETHODCALLTYPE Popup(POINTL *ppt, RECTL *prcExclude, MP_POPUPFLAGS
dwFlags);
+ virtual HRESULT STDMETHODCALLTYPE OnSelect(DWORD dwSelectType);
+ virtual HRESULT STDMETHODCALLTYPE SetSubMenu(IMenuPopup *pmp, BOOL fSet);
+
+ // *** IDeskBar methods ***
+ virtual HRESULT STDMETHODCALLTYPE SetClient(IUnknown *punkClient);
+ virtual HRESULT STDMETHODCALLTYPE GetClient(IUnknown **ppunkClient);
+ virtual HRESULT STDMETHODCALLTYPE OnPosRectChangeDB(RECT *prc);
+
+ // *** IMenuBand methods ***
+ virtual HRESULT STDMETHODCALLTYPE IsMenuMessage(MSG *pmsg);
+ virtual HRESULT STDMETHODCALLTYPE TranslateMenuMessage(MSG *pmsg, LRESULT *plRet);
+
+ // *** IShellMenu methods ***
+ virtual HRESULT STDMETHODCALLTYPE Initialize(IShellMenuCallback *psmc, UINT uId, UINT
uIdAncestor, DWORD dwFlags);
+ virtual HRESULT STDMETHODCALLTYPE GetMenuInfo(IShellMenuCallback **ppsmc, UINT *puId,
UINT *puIdAncestor, DWORD *pdwFlags);
+ virtual HRESULT STDMETHODCALLTYPE SetShellFolder(IShellFolder *psf, LPCITEMIDLIST
pidlFolder, HKEY hKey, DWORD dwFlags);
+ virtual HRESULT STDMETHODCALLTYPE GetShellFolder(DWORD *pdwFlags, LPITEMIDLIST
*ppidl, REFIID riid, void **ppv);
+ virtual HRESULT STDMETHODCALLTYPE SetMenu(HMENU hmenu, HWND hwnd, DWORD dwFlags);
+ virtual HRESULT STDMETHODCALLTYPE GetMenu(HMENU *phmenu, HWND *phwnd, DWORD
*pdwFlags);
+ virtual HRESULT STDMETHODCALLTYPE InvalidateItem(LPSMDATA psmd, DWORD dwFlags);
+ virtual HRESULT STDMETHODCALLTYPE GetState(LPSMDATA psmd);
+ virtual HRESULT STDMETHODCALLTYPE SetMenuToolbar(IUnknown *punk, DWORD dwFlags);
+
+ // *** IWinEventHandler methods ***
+ virtual HRESULT STDMETHODCALLTYPE OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam,
LPARAM lParam, LRESULT *theResult);
+ virtual HRESULT STDMETHODCALLTYPE IsWindowOwner(HWND hWnd);
+
+ // *** IShellMenu2 methods ***
+ virtual HRESULT STDMETHODCALLTYPE GetSubMenu(THIS);
+ virtual HRESULT STDMETHODCALLTYPE SetToolbar(THIS);
+ virtual HRESULT STDMETHODCALLTYPE SetMinWidth(THIS);
+ virtual HRESULT STDMETHODCALLTYPE SetNoBorder(THIS);
+ virtual HRESULT STDMETHODCALLTYPE SetTheme(THIS);
+
+ // *** IShellMenuAcc methods ***
+ virtual HRESULT STDMETHODCALLTYPE GetTop(THIS);
+ virtual HRESULT STDMETHODCALLTYPE GetBottom(THIS);
+ virtual HRESULT STDMETHODCALLTYPE GetTracked(THIS);
+ virtual HRESULT STDMETHODCALLTYPE GetParentSite(THIS);
+ virtual HRESULT STDMETHODCALLTYPE GetState(THIS);
+ virtual HRESULT STDMETHODCALLTYPE DoDefaultAction(THIS);
+ virtual HRESULT STDMETHODCALLTYPE IsEmpty(THIS);
+
+ DECLARE_NOT_AGGREGATABLE(CMenuBandWrap)
+ DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+ BEGIN_COM_MAP(CMenuBandWrap)
+ COM_INTERFACE_ENTRY_IID(IID_IDeskBar, IMenuPopup)
+ COM_INTERFACE_ENTRY_IID(IID_IShellMenu, IShellMenu)
+ COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
+ COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IDeskBand)
+ COM_INTERFACE_ENTRY_IID(IID_IDockingWindow, IDockingWindow)
+ COM_INTERFACE_ENTRY_IID(IID_IDeskBand, IDeskBand)
+ COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite)
+ COM_INTERFACE_ENTRY_IID(IID_IInputObject, IInputObject)
+ COM_INTERFACE_ENTRY_IID(IID_IPersistStream, IPersistStream)
+ COM_INTERFACE_ENTRY_IID(IID_IPersist, IPersistStream)
+ COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
+ COM_INTERFACE_ENTRY_IID(IID_IMenuPopup, IMenuPopup)
+ COM_INTERFACE_ENTRY_IID(IID_IMenuBand, IMenuBand)
+ COM_INTERFACE_ENTRY_IID(IID_IShellMenu2, IShellMenu2)
+ COM_INTERFACE_ENTRY_IID(IID_IWinEventHandler, IWinEventHandler)
+ COM_INTERFACE_ENTRY_IID(IID_IShellMenuAcc, IShellMenuAcc)
+ END_COM_MAP()
+};
+
+extern "C"
+HRESULT CMenuBand_Wrapper(REFIID riid, LPVOID *ppv)
+{
+ *ppv = NULL;
+
+ CMenuBandWrap * site = new CComObject<CMenuBandWrap>();
+
+ if (!site)
+ return E_OUTOFMEMORY;
+
+ HRESULT hr = site->QueryInterface(riid, ppv);
+
+ if (FAILED(hr))
+ site->Release();
+
+ return hr;
+}
+
+CMenuBandWrap::CMenuBandWrap()
+{
+ WrapLogOpen();
+
+ CoCreateInstance(CLSID_MenuBand, NULL, CLSCTX_INPROC_SERVER, IID_PPV_ARG(IShellMenu,
&m_IShellMenu));
+ m_IShellMenu->QueryInterface(IID_PPV_ARG(IUnknown, &m_IUnknown));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IDeskBand, &m_IDeskBand));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IDockingWindow, &m_IDockingWindow));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IOleWindow, &m_IOleWindow));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IObjectWithSite, &m_IObjectWithSite));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IInputObject, &m_IInputObject));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IPersistStream, &m_IPersistStream));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IPersist, &m_IPersist));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IOleCommandTarget,
&m_IOleCommandTarget));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IServiceProvider,
&m_IServiceProvider));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IMenuPopup, &m_IMenuPopup));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IDeskBar, &m_IDeskBar));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IMenuBand, &m_IMenuBand));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IShellMenu2, &m_IShellMenu2));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IWinEventHandler,
&m_IWinEventHandler));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IShellMenuAcc, &m_IShellMenuAcc));
+}
+
+CMenuBandWrap::~CMenuBandWrap()
+{
+ m_IUnknown->Release();
+ m_IDeskBand->Release();
+ m_IDockingWindow->Release();
+ m_IOleWindow->Release();
+ m_IObjectWithSite->Release();
+ m_IInputObject->Release();
+ m_IPersistStream->Release();
+ m_IPersist->Release();
+ m_IOleCommandTarget->Release();
+ m_IServiceProvider->Release();
+ m_IMenuPopup->Release();
+ m_IDeskBar->Release();
+ m_IMenuBand->Release();
+ m_IShellMenu2->Release();
+ m_IShellMenu->Release();
+ m_IWinEventHandler->Release();
+ m_IShellMenuAcc->Release();
+ WrapLogClose();
+}
+
+
+// *** IShellMenu2 methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetSubMenu(THIS)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetSubMenu()\n", this);
+ HRESULT hr = m_IShellMenu2->GetSubMenu();
+ WrapLogExit("CMenuBandWrap::GetSubMenu() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::SetToolbar(THIS)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::SetToolbar()\n", this);
+ HRESULT hr = m_IShellMenu2->SetToolbar();
+ WrapLogExit("CMenuBandWrap::SetToolbar() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::SetMinWidth(THIS)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::SetMinWidth()\n", this);
+ HRESULT hr = m_IShellMenu2->SetMinWidth();
+ WrapLogExit("CMenuBandWrap::SetMinWidth() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::SetNoBorder(THIS)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::SetNoBorder()\n", this);
+ HRESULT hr = m_IShellMenu2->SetNoBorder();
+ WrapLogExit("CMenuBandWrap::SetNoBorder() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::SetTheme(THIS)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::SetTheme()\n", this);
+ HRESULT hr = m_IShellMenu2->SetTheme();
+ WrapLogExit("CMenuBandWrap::SetTheme() = %08x\n", hr);
+ return hr;
+}
+
+
+// *** IShellMenuAcc methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetTop(THIS)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetTop()\n", this);
+ HRESULT hr = m_IShellMenuAcc->GetTop();
+ WrapLogExit("CMenuBandWrap::GetTop() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetBottom(THIS)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
+ HRESULT hr = m_IShellMenuAcc->GetBottom();
+ WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetTracked(THIS)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
+ HRESULT hr = m_IShellMenuAcc->GetBottom();
+ WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetParentSite(THIS)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
+ HRESULT hr = m_IShellMenuAcc->GetBottom();
+ WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetState(THIS)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
+ HRESULT hr = m_IShellMenuAcc->GetBottom();
+ WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::DoDefaultAction(THIS)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
+ HRESULT hr = m_IShellMenuAcc->GetBottom();
+ WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::IsEmpty(THIS)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
+ HRESULT hr = m_IShellMenuAcc->GetBottom();
+ WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr);
+ return hr;
+}
+
+// *** IDeskBand methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetBandInfo(DWORD dwBandID, DWORD dwViewMode,
DESKBANDINFO *pdbi)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetBandInfo(DWORD dwBandID=%d, DWORD
dwViewMode=%d, DESKBANDINFO *pdbi=%p)\n", this, dwBandID, dwViewMode, pdbi);
+ HRESULT hr = m_IDeskBand->GetBandInfo(dwBandID, dwViewMode, pdbi);
+ WrapLogExit("CMenuBandWrap::GetBandInfo() = %08x\n", hr);
+ return hr;
+}
+
+// *** IDockingWindow methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::ShowDW(BOOL fShow)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::ShowDW(BOOL fShow=%d)\n", this,
fShow);
+ HRESULT hr = m_IDockingWindow->ShowDW(fShow);
+ WrapLogExit("CMenuBandWrap::ShowDW() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::CloseDW(DWORD dwReserved)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::CloseDW(DWORD dwReserved=%d)\n",
this, dwReserved);
+ HRESULT hr = m_IDockingWindow->CloseDW(dwReserved);
+ WrapLogExit("CMenuBandWrap::CloseDW() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::ResizeBorderDW(LPCRECT prcBorder, IUnknown
*punkToolbarSite, BOOL fReserved)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::ResizeBorderDW(LPCRECT prcBorder=%p,
IUnknown *punkToolbarSite=%p, BOOL fReserved=%d)\n", this, prcBorder,
punkToolbarSite, fReserved);
+ if (prcBorder) WrapLogMsg("*prcBorder=%s\n", Wrap(*prcBorder));
+ HRESULT hr = m_IDockingWindow->ResizeBorderDW(prcBorder, punkToolbarSite,
fReserved);
+ if (prcBorder) WrapLogMsg("*prcBorder=%s\n", Wrap(*prcBorder));
+ WrapLogExit("CMenuBandWrap::ResizeBorderDW() = %08x\n", hr);
+ return hr;
+}
+
+// *** IOleWindow methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetWindow(HWND *phwnd)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetWindow(HWND *phwnd=%p)\n", this,
phwnd);
+ HRESULT hr = m_IOleWindow->GetWindow(phwnd);
+ if (phwnd) WrapLogMsg("*phwnd=%p\n", *phwnd);
+ WrapLogExit("CMenuBandWrap::GetWindow() = %08x\n", hr);
+ return hr;
+}
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::ContextSensitiveHelp(BOOL fEnterMode)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::ContextSensitiveHelp(BOOL
fEnterMode=%d)\n", this, fEnterMode);
+ HRESULT hr = m_IOleWindow->ContextSensitiveHelp(fEnterMode);
+ WrapLogExit("CMenuBandWrap::ContextSensitiveHelp() = %08x\n", hr);
+ return hr;
+}
+
+// *** IWinEventHandler methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam,
LPARAM lParam, LRESULT *theResult)
+{
+ //WrapLogEnter("CMenuBandWrap<%p>::OnWinEvent(HWND hWnd=%p, UINT uMsg=%u,
WPARAM wParam=%08x, LPARAM lParam=%08x, LRESULT *theResult=%p)\n", this, hWnd, uMsg,
wParam, lParam, theResult);
+ HRESULT hr = m_IWinEventHandler->OnWinEvent(hWnd, uMsg, wParam, lParam,
theResult);
+ //WrapLogExit("CMenuBandWrap::OnWinEvent() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::IsWindowOwner(HWND hWnd)
+{
+ //WrapLogEnter("CMenuBandWrap<%p>::IsWindowOwner(HWND hWnd=%08x)\n",
this, hWnd);
+ HRESULT hr = m_IWinEventHandler->IsWindowOwner(hWnd);
+ //WrapLogExit("CMenuBandWrap::IsWindowOwner() = %08x\n", hr);
+ return hr;
+}
+
+// *** IObjectWithSite methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::SetSite(IUnknown *pUnkSite)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::SetSite(IUnknown *pUnkSite=%p)\n",
this, pUnkSite);
+ HRESULT hr = m_IObjectWithSite->SetSite(pUnkSite);
+ WrapLogExit("CMenuBandWrap::SetSite() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetSite(REFIID riid, PVOID *ppvSite)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetSite(REFIID riid=%s, PVOID
*ppvSite=%p)\n", this, Wrap(riid), ppvSite);
+ HRESULT hr = m_IObjectWithSite->GetSite(riid, ppvSite);
+ if (ppvSite) WrapLogMsg("*ppvSite=%p\n", *ppvSite);
+ WrapLogExit("CMenuBandWrap::GetSite() = %08x\n", hr);
+ return hr;
+}
+
+// *** IInputObject methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::UIActivateIO(BOOL fActivate, LPMSG lpMsg)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::UIActivateIO(BOOL fActivate=%d, LPMSG
lpMsg=%p)\n", this, fActivate, lpMsg);
+ HRESULT hr = m_IInputObject->UIActivateIO(fActivate, lpMsg);
+ WrapLogExit("CMenuBandWrap::UIActivateIO() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::HasFocusIO()
+{
+ WrapLogEnter("CMenuBandWrap<%p>::HasFocusIO()\n", this);
+ HRESULT hr = m_IInputObject->HasFocusIO();
+ WrapLogExit("CMenuBandWrap::HasFocusIO() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::TranslateAcceleratorIO(LPMSG lpMsg)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::TranslateAcceleratorIO(LPMSG
lpMsg=%p)\n", this, lpMsg);
+ if (lpMsg) WrapLogMsg("*lpMsg=%s\n", Wrap(*lpMsg));
+ HRESULT hr = m_IInputObject->TranslateAcceleratorIO(lpMsg);
+ WrapLogExit("CMenuBandWrap::TranslateAcceleratorIO() = %08x\n", hr);
+ return hr;
+}
+
+// *** IPersistStream methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::IsDirty()
+{
+ WrapLogEnter("CMenuBandWrap<%p>::IsDirty()\n", this);
+ HRESULT hr = m_IPersistStream->IsDirty();
+ WrapLogExit("CMenuBandWrap::IsDirty() = %08x\n", hr);
+ return hr;
+}
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::Load(IStream *pStm)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::Load(IStream *pStm=%p)\n", this,
pStm);
+ HRESULT hr = m_IPersistStream->Load(pStm);
+ WrapLogExit("CMenuBandWrap::Load() = %08x\n", hr);
+ return hr;
+}
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::Save(IStream *pStm, BOOL fClearDirty)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::Save(IStream *pStm=%p, BOOL
fClearDirty=%d)\n", this, pStm, fClearDirty);
+ HRESULT hr = m_IPersistStream->Save(pStm, fClearDirty);
+ WrapLogExit("CMenuBandWrap::Save() = %08x\n", hr);
+ return hr;
+}
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetSizeMax(ULARGE_INTEGER *pcbSize)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetSizeMax(ULARGE_INTEGER
*pcbSize=%p)\n", this, pcbSize);
+ HRESULT hr = m_IPersistStream->GetSizeMax(pcbSize);
+ WrapLogExit("CMenuBandWrap::GetSizeMax() = %08x\n", hr);
+ return hr;
+}
+
+// *** IPersist methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetClassID(CLSID *pClassID)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetClassID(CLSID *pClassID=%p)\n",
this, pClassID);
+ HRESULT hr = m_IPersist->GetClassID(pClassID);
+ if (pClassID) WrapLogMsg("*pClassID=%s\n", Wrap(*pClassID));
+ WrapLogExit("CMenuBandWrap::GetClassID() = %08x\n", hr);
+ return hr;
+}
+
+// *** IOleCommandTarget methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::QueryStatus(const GUID *pguidCmdGroup, ULONG
cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::QueryStatus(const GUID *pguidCmdGroup=%p,
ULONG cCmds=%u, prgCmds=%p, pCmdText=%p)\n", this, pguidCmdGroup, cCmds, prgCmds,
pCmdText);
+ HRESULT hr = m_IOleCommandTarget->QueryStatus(pguidCmdGroup, cCmds, prgCmds,
pCmdText);
+ if (pguidCmdGroup) WrapLogMsg("*pguidCmdGroup=%s\n",
Wrap(*pguidCmdGroup));
+ WrapLogExit("CMenuBandWrap::QueryStatus() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::Exec(const GUID *pguidCmdGroup, DWORD nCmdID,
DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::Exec(const GUID *pguidCmdGroup=%p, DWORD
nCmdID=%d, DWORD nCmdexecopt=%d, VARIANT *pvaIn=%p, VARIANT *pvaOut=%p)\n", this,
pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
+ if (pguidCmdGroup) WrapLogMsg("*pguidCmdGroup=%s\n",
Wrap(*pguidCmdGroup));
+ HRESULT hr = m_IOleCommandTarget->Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn,
pvaOut);
+ WrapLogExit("CMenuBandWrap::Exec() = %08x\n", hr);
+ return hr;
+}
+
+// *** IServiceProvider methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::QueryService(REFGUID guidService, REFIID riid,
void **ppvObject)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::QueryService(REFGUID guidService=%s,
REFIID riid=%s, void **ppvObject=%p)\n", this, Wrap(guidService), Wrap(riid),
ppvObject);
+
+ if (IsEqualIID(guidService, SID_SMenuBandChild))
+ {
+ WrapLogMsg("SID is SID_SMenuBandChild. Using QueryInterface of self instead
of wrapped object.\n");
+ HRESULT hr = this->QueryInterface(riid, ppvObject);
+ if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
+ if (SUCCEEDED(hr))
+ {
+ WrapLogExit("CMenuBandWrap::QueryService() = %08x\n", hr);
+ return hr;
+ }
+ else
+ {
+ WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
+ }
+ }
+ else if (IsEqualIID(guidService, SID_SMenuBandBottom))
+ {
+ WrapLogMsg("SID is SID_SMenuBandBottom. Using QueryInterface of self instead
of wrapped object.\n");
+ HRESULT hr = this->QueryInterface(riid, ppvObject);
+ if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
+ if (SUCCEEDED(hr))
+ {
+ WrapLogExit("CMenuBandWrap::QueryService() = %08x\n", hr);
+ return hr;
+ }
+ else
+ {
+ WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
+ }
+ }
+ else if (IsEqualIID(guidService, SID_SMenuBandBottomSelected))
+ {
+ WrapLogMsg("SID is SID_SMenuBandBottomSelected. Using QueryInterface of self
instead of wrapped object.\n");
+ HRESULT hr = this->QueryInterface(riid, ppvObject);
+ if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
+ if (SUCCEEDED(hr))
+ {
+ WrapLogExit("CMenuBandWrap::QueryService() = %08x\n", hr);
+ return hr;
+ }
+ else
+ {
+ WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
+ }
+ }
+ else
+ {
+ WrapLogMsg("SID not identified.\n");
+ }
+ HRESULT hr = m_IServiceProvider->QueryService(guidService, riid, ppvObject);
+ if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
+ WrapLogExit("CMenuBandWrap::QueryService() = %08x\n", hr);
+ return hr;
+}
+
+
+// *** IMenuPopup methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::Popup(POINTL *ppt, RECTL *prcExclude,
MP_POPUPFLAGS dwFlags)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::Popup(POINTL *ppt=%p, RECTL
*prcExclude=%p, MP_POPUPFLAGS dwFlags=%08x)\n", this, ppt, prcExclude, dwFlags);
+ HRESULT hr = m_IMenuPopup->Popup(ppt, prcExclude, dwFlags);
+ WrapLogExit("CMenuBandWrap::Popup() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::OnSelect(DWORD dwSelectType)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::OnSelect(DWORD
dwSelectType=%08x)\n", this, dwSelectType);
+ HRESULT hr = m_IMenuPopup->OnSelect(dwSelectType);
+ WrapLogExit("CMenuBandWrap::OnSelect() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::SetSubMenu(IMenuPopup *pmp, BOOL fSet)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::SetSubMenu(IMenuPopup *pmp=%p, BOOL
fSet=%d)\n", this, pmp, fSet);
+ HRESULT hr = m_IMenuPopup->SetSubMenu(pmp, fSet);
+ WrapLogExit("CMenuBandWrap::SetSubMenu() = %08x\n", hr);
+ return hr;
+}
+
+
+// *** IDeskBar methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::SetClient(IUnknown *punkClient)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::SetClient(IUnknown
*punkClient=%p)\n", this, punkClient);
+ HRESULT hr = m_IDeskBar->SetClient(punkClient);
+ WrapLogExit("CMenuBandWrap::SetClient() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetClient(IUnknown **ppunkClient)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetClient(IUnknown
**ppunkClient=%p)\n", this, ppunkClient);
+ HRESULT hr = m_IDeskBar->GetClient(ppunkClient);
+ if (ppunkClient) WrapLogMsg("*ppunkClient=%p\n", *ppunkClient);
+ WrapLogExit("CMenuBandWrap::GetClient() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::OnPosRectChangeDB(RECT *prc)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::OnPosRectChangeDB(RECT *prc=%p)\n",
this, prc);
+ HRESULT hr = m_IDeskBar->OnPosRectChangeDB(prc);
+ if (prc) WrapLogMsg("*prc=%s\n", Wrap(*prc));
+ WrapLogExit("CMenuBandWrap::OnPosRectChangeDB() = %08x\n", hr);
+ return hr;
+}
+
+
+// *** IMenuBand methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::IsMenuMessage(MSG *pmsg)
+{
+ //WrapLogEnter("CMenuBandWrap<%p>::IsMenuMessage(MSG *pmsg=%p)\n",
this, pmsg);
+ HRESULT hr = m_IMenuBand->IsMenuMessage(pmsg);
+ //WrapLogExit("CMenuBandWrap::IsMenuMessage() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::TranslateMenuMessage(MSG *pmsg, LRESULT *plRet)
+{
+ //WrapLogEnter("CMenuBandWrap<%p>::TranslateMenuMessage(MSG *pmsg=%p,
LRESULT *plRet=%p)\n", this, pmsg, plRet);
+ HRESULT hr = m_IMenuBand->TranslateMenuMessage(pmsg, plRet);
+ //WrapLogExit("CMenuBandWrap::TranslateMenuMessage(*plRet=%d) = %08x\n",
*plRet, hr);
+ return hr;
+}
+
+// *** IShellMenu methods ***
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::Initialize(IShellMenuCallback *psmc, UINT uId,
UINT uIdAncestor, DWORD dwFlags)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::Initialize(IShellMenuCallback *psmc=%p,
UINT uId=%u, UINT uIdAncestor=%u, DWORD dwFlags=%08x)\n", this, psmc, uId,
uIdAncestor, dwFlags);
+ HRESULT hr = m_IShellMenu->Initialize(psmc, uId, uIdAncestor, dwFlags);
+ WrapLogExit("CMenuBandWrap::Initialize() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetMenuInfo(IShellMenuCallback **ppsmc, UINT
*puId, UINT *puIdAncestor, DWORD *pdwFlags)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetMenuInfo(IShellMenuCallback
**ppsmc=%p, UINT *puId=%p, UINT *puIdAncestor=%p, DWORD *pdwFlags=%p)\n", this,
ppsmc, puId, puIdAncestor, pdwFlags);
+ HRESULT hr = m_IShellMenu->GetMenuInfo(ppsmc, puId, puIdAncestor, pdwFlags);
+ if (ppsmc) WrapLogMsg("*ppsmc=%p\n", *ppsmc);
+ if (puId) WrapLogMsg("*puId=%u\n", *puId);
+ if (puIdAncestor) WrapLogMsg("*puIdAncestor=%u\n", *puIdAncestor);
+ if (pdwFlags) WrapLogMsg("*pdwFlags=%08x\n", *pdwFlags);
+ WrapLogExit("CMenuBandWrap::GetMenuInfo() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::SetShellFolder(IShellFolder *psf, LPCITEMIDLIST
pidlFolder, HKEY hKey, DWORD dwFlags)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::SetShellFolder(IShellFolder *psf=%p,
LPCITEMIDLIST pidlFolder=%p, HKEY hKey=%p, DWORD dwFlags=%08x)\n", this, psf,
pidlFolder, hKey, dwFlags);
+ HRESULT hr = m_IShellMenu->SetShellFolder(psf, pidlFolder, hKey, dwFlags);
+ WrapLogExit("CMenuBandWrap::SetShellFolder() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetShellFolder(DWORD *pdwFlags, LPITEMIDLIST
*ppidl, REFIID riid, void **ppv)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetShellFolder(DWORD *pdwFlags=%p,
LPITEMIDLIST *ppidl=%p, REFIID riid=%s, void **ppv=%p)\n", this, pdwFlags, ppidl,
Wrap(riid), ppv);
+ HRESULT hr = m_IShellMenu->GetShellFolder(pdwFlags, ppidl, riid, ppv);
+ if (pdwFlags) WrapLogMsg("*pdwFlags=%08x\n", *pdwFlags);
+ if (ppidl) WrapLogMsg("*ppidl=%p\n", *ppidl);
+ if (ppv) WrapLogMsg("*ppv=%p\n", *ppv);
+ WrapLogExit("CMenuBandWrap::GetShellFolder() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::SetMenu(HMENU hmenu, HWND hwnd, DWORD dwFlags)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::SetMenu(HMENU hmenu=%p, HWND hwnd=%p,
DWORD dwFlags=%08x)\n", this, hmenu, hwnd, dwFlags);
+ HRESULT hr = m_IShellMenu->SetMenu(hmenu, hwnd, dwFlags);
+ WrapLogExit("CMenuBandWrap::SetMenu() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetMenu(HMENU *phmenu, HWND *phwnd, DWORD
*pdwFlags)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetMenu(HMENU *phmenu=%p, HWND *phwnd=%p,
DWORD *pdwFlags=%p)\n", this, phmenu, phwnd, pdwFlags);
+ HRESULT hr = m_IShellMenu->GetMenu(phmenu, phwnd, pdwFlags);
+ if (phmenu) WrapLogMsg("*phmenu=%p\n", *phmenu);
+ if (phwnd) WrapLogMsg("*phwnd=%p\n", *phwnd);
+ if (pdwFlags) WrapLogMsg("*pdwFlags=%08x\n", *pdwFlags);
+ WrapLogExit("CMenuBandWrap::GetMenu() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::InvalidateItem(LPSMDATA psmd, DWORD dwFlags)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::InvalidateItem(LPSMDATA psmd=%p, DWORD
dwFlags=%08x)\n", this, psmd, dwFlags);
+ HRESULT hr = m_IShellMenu->InvalidateItem(psmd, dwFlags);
+ WrapLogExit("CMenuBandWrap::InvalidateItem() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::GetState(LPSMDATA psmd)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::GetState(LPSMDATA psmd=%p)\n", this,
psmd);
+ HRESULT hr = m_IShellMenu->GetState(psmd);
+ WrapLogExit("CMenuBandWrap::GetState() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuBandWrap::SetMenuToolbar(IUnknown *punk, DWORD dwFlags)
+{
+ WrapLogEnter("CMenuBandWrap<%p>::SetMenuToolbar(IUnknown *punk=%p, DWORD
dwFlags=%08x)\n", this, punk, dwFlags);
+ HRESULT hr = m_IShellMenu->SetMenuToolbar(punk, dwFlags);
+ WrapLogExit("CMenuBandWrap::SetMenuToolbar() = %08x\n", hr);
+ return hr;
+}
Propchange: branches/shell-experiments/base/shell/rshell/logging/CMenuBandWrap.cpp
------------------------------------------------------------------------------
svn:eol-style = CRLF
Added: branches/shell-experiments/base/shell/rshell/logging/CMenuDeskBarWrap.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/logging/CMenuDeskBarWrap.cpp (added)
+++ branches/shell-experiments/base/shell/rshell/logging/CMenuDeskBarWrap.cpp [iso-8859-1]
Wed Feb 19 00:20:45 2014
@@ -0,0 +1,414 @@
+/*
+* Shell Menu Desk Bar
+*
+* Copyright 2014 David Quintana
+*
+* 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
+*/
+#include "precomp.h"
+#include "wraplog.h"
+
+class CMenuDeskBarWrap :
+ public CComCoClass<CMenuDeskBarWrap>,
+ public CComObjectRootEx<CComMultiThreadModelNoCS>,
+ public IOleCommandTarget,
+ public IServiceProvider,
+ public IInputObjectSite,
+ public IInputObject,
+ public IMenuPopup,
+ public IObjectWithSite,
+ public IBanneredBar,
+ public IInitializeObject
+{
+public:
+ CMenuDeskBarWrap();
+ ~CMenuDeskBarWrap();
+
+private:
+ IUnknown * m_IUnknown;
+ IMenuPopup * m_IMenuPopup;
+ IOleCommandTarget * m_IOleCommandTarget;
+ IServiceProvider * m_IServiceProvider;
+ IDeskBar * m_IDeskBar;
+ IOleWindow * m_IOleWindow;
+ IInputObjectSite * m_IInputObjectSite;
+ IInputObject * m_IInputObject;
+ IObjectWithSite * m_IObjectWithSite;
+ IBanneredBar * m_IBanneredBar;
+ IInitializeObject * m_IInitializeObject;
+
+public:
+ // *** IMenuPopup methods ***
+ virtual HRESULT STDMETHODCALLTYPE Popup(POINTL *ppt, RECTL *prcExclude, MP_POPUPFLAGS
dwFlags);
+ virtual HRESULT STDMETHODCALLTYPE OnSelect(DWORD dwSelectType);
+ virtual HRESULT STDMETHODCALLTYPE SetSubMenu(IMenuPopup *pmp, BOOL fSet);
+
+ // *** IOleWindow methods ***
+ virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *phwnd);
+ virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL fEnterMode);
+
+ // *** IObjectWithSite methods ***
+ virtual HRESULT STDMETHODCALLTYPE SetSite(IUnknown *pUnkSite);
+ virtual HRESULT STDMETHODCALLTYPE GetSite(REFIID riid, PVOID *ppvSite);
+
+ // *** IBanneredBar methods ***
+ virtual HRESULT STDMETHODCALLTYPE SetIconSize(DWORD iIcon);
+ virtual HRESULT STDMETHODCALLTYPE GetIconSize(DWORD* piIcon);
+ virtual HRESULT STDMETHODCALLTYPE SetBitmap(HBITMAP hBitmap);
+ virtual HRESULT STDMETHODCALLTYPE GetBitmap(HBITMAP* phBitmap);
+
+ // *** IInitializeObject methods ***
+ virtual HRESULT STDMETHODCALLTYPE Initialize(THIS);
+
+ // *** IOleCommandTarget methods ***
+ virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *pguidCmdGroup, ULONG cCmds,
OLECMD prgCmds [], OLECMDTEXT *pCmdText);
+ virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *pguidCmdGroup, DWORD nCmdID, DWORD
nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut);
+
+ // *** IServiceProvider methods ***
+ virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, void
**ppvObject);
+
+ // *** IInputObjectSite methods ***
+ virtual HRESULT STDMETHODCALLTYPE OnFocusChangeIS(LPUNKNOWN lpUnknown, BOOL bFocus);
+
+ // *** IInputObject methods ***
+ virtual HRESULT STDMETHODCALLTYPE UIActivateIO(BOOL bActivating, LPMSG lpMsg);
+ virtual HRESULT STDMETHODCALLTYPE HasFocusIO(THIS);
+ virtual HRESULT STDMETHODCALLTYPE TranslateAcceleratorIO(LPMSG lpMsg);
+
+ // *** IDeskBar methods ***
+ virtual HRESULT STDMETHODCALLTYPE SetClient(IUnknown *punkClient);
+ virtual HRESULT STDMETHODCALLTYPE GetClient(IUnknown **ppunkClient);
+ virtual HRESULT STDMETHODCALLTYPE OnPosRectChangeDB(LPRECT prc);
+
+ DECLARE_NOT_AGGREGATABLE(CMenuDeskBarWrap)
+ DECLARE_PROTECT_FINAL_CONSTRUCT()
+
+ BEGIN_COM_MAP(CMenuDeskBarWrap)
+ COM_INTERFACE_ENTRY_IID(IID_IMenuPopup, IMenuPopup)
+ COM_INTERFACE_ENTRY_IID(IID_IOleCommandTarget, IOleCommandTarget)
+ COM_INTERFACE_ENTRY_IID(IID_IServiceProvider, IServiceProvider)
+ COM_INTERFACE_ENTRY_IID(IID_IInputObjectSite, IInputObjectSite)
+ COM_INTERFACE_ENTRY_IID(IID_IInputObject, IInputObject)
+ COM_INTERFACE_ENTRY_IID(IID_IDeskBar, IMenuPopup)
+ COM_INTERFACE_ENTRY_IID(IID_IOleWindow, IMenuPopup)
+ COM_INTERFACE_ENTRY_IID(IID_IObjectWithSite, IObjectWithSite)
+ COM_INTERFACE_ENTRY_IID(IID_IBanneredBar, IBanneredBar)
+ COM_INTERFACE_ENTRY_IID(IID_IInitializeObject, IInitializeObject)
+ END_COM_MAP()
+};
+
+extern "C"
+HRESULT CMenuDeskBar_Wrapper(REFIID riid, LPVOID *ppv)
+{
+ *ppv = NULL;
+
+ CMenuDeskBarWrap * deskbar = new CComObject<CMenuDeskBarWrap>();
+
+ if (!deskbar)
+ return E_OUTOFMEMORY;
+
+ HRESULT hr = deskbar->QueryInterface(riid, ppv);
+
+ if (FAILED(hr))
+ deskbar->Release();
+
+ return hr;
+}
+
+CMenuDeskBarWrap::CMenuDeskBarWrap()
+{
+ WrapLogOpen();
+
+ CoCreateInstance(CLSID_MenuDeskBar, NULL, CLSCTX_INPROC_SERVER,
IID_PPV_ARG(IMenuPopup, &m_IMenuPopup));
+ m_IMenuPopup->QueryInterface(IID_PPV_ARG(IUnknown, &m_IUnknown));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IOleCommandTarget,
&m_IOleCommandTarget));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IServiceProvider,
&m_IServiceProvider));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IDeskBar, &m_IDeskBar));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IOleWindow, &m_IOleWindow));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IInputObjectSite,
&m_IInputObjectSite));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IInputObject, &m_IInputObject));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IObjectWithSite, &m_IObjectWithSite));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IBanneredBar, &m_IBanneredBar));
+ m_IUnknown->QueryInterface(IID_PPV_ARG(IInitializeObject,
&m_IInitializeObject));
+}
+
+CMenuDeskBarWrap::~CMenuDeskBarWrap()
+{
+ m_IUnknown->Release();
+ m_IMenuPopup->Release();
+ m_IOleCommandTarget->Release();
+ m_IServiceProvider->Release();
+ m_IDeskBar->Release();
+ m_IOleWindow->Release();
+ m_IInputObjectSite->Release();
+ m_IInputObject->Release();
+ m_IObjectWithSite->Release();
+ m_IBanneredBar->Release();
+ m_IInitializeObject->Release();
+
+ WrapLogClose();
+}
+
+// *** IMenuPopup methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::Popup(POINTL *ppt, RECTL *prcExclude,
MP_POPUPFLAGS dwFlags)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::Popup(POINTL *ppt=%p, RECTL
*prcExclude=%p, MP_POPUPFLAGS dwFlags=%08x)\n", this, ppt, prcExclude, dwFlags);
+ HRESULT hr = m_IMenuPopup->Popup(ppt, prcExclude, dwFlags);
+ WrapLogExit("CMenuDeskBarWrap::Popup() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::OnSelect(DWORD dwSelectType)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::OnSelect(DWORD
dwSelectType=%08x)\n", this, dwSelectType);
+ HRESULT hr = m_IMenuPopup->OnSelect(dwSelectType);
+ WrapLogExit("CMenuDeskBarWrap::OnSelect() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::SetSubMenu(IMenuPopup *pmp, BOOL fSet)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::SetSubMenu(IMenuPopup *pmp=%p, BOOL
fSet=%d)\n", this, pmp, fSet);
+ HRESULT hr = m_IMenuPopup->SetSubMenu(pmp, fSet);
+ WrapLogExit("CMenuDeskBarWrap::SetSubMenu() = %08x\n", hr);
+ return hr;
+}
+
+// *** IOleWindow methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::GetWindow(HWND *phwnd)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::GetWindow(HWND *phwnd=%p)\n",
this, phwnd);
+ HRESULT hr = m_IOleWindow->GetWindow(phwnd);
+ if (phwnd) WrapLogMsg("*phwnd=%p\n", *phwnd);
+ WrapLogExit("CMenuDeskBarWrap::GetWindow() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::ContextSensitiveHelp(BOOL fEnterMode)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::ContextSensitiveHelp(BOOL
fEnterMode=%d)\n", this, fEnterMode);
+ HRESULT hr = m_IOleWindow->ContextSensitiveHelp(fEnterMode);
+ WrapLogExit("CMenuDeskBarWrap::ContextSensitiveHelp() = %08x\n", hr);
+ return hr;
+}
+
+// *** IObjectWithSite methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::SetSite(IUnknown *pUnkSite)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::SetSite(IUnknown
*pUnkSite=%p)\n", this, pUnkSite);
+ HRESULT hr = m_IObjectWithSite->SetSite(pUnkSite);
+ WrapLogExit("CMenuDeskBarWrap::SetSite() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::GetSite(REFIID riid, PVOID *ppvSite)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::GetSite(REFIID riid=%s, PVOID
*ppvSite=%p)\n", this, Wrap(riid), ppvSite);
+ HRESULT hr = m_IObjectWithSite->GetSite(riid, ppvSite);
+ if (ppvSite) WrapLogMsg("*ppvSite=%p\n", *ppvSite);
+ WrapLogExit("CMenuDeskBarWrap::GetSite() = %08x\n", hr);
+ return hr;
+}
+
+// *** IBanneredBar methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::SetIconSize(DWORD iIcon)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::SetIconSize(DWORD iIcon=%d)\n",
this, iIcon);
+ HRESULT hr = m_IBanneredBar->SetIconSize(iIcon);
+ WrapLogExit("CMenuDeskBarWrap::SetIconSize() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::GetIconSize(DWORD* piIcon)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::GetIconSize(DWORD* piIcon=%p)\n",
this, piIcon);
+ HRESULT hr = m_IBanneredBar->GetIconSize(piIcon);
+ if (piIcon) WrapLogMsg("*piIcon=%d\n", *piIcon);
+ WrapLogExit("CMenuDeskBarWrap::GetIconSize() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::SetBitmap(HBITMAP hBitmap)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::SetBitmap(HBITMAP hBitmap=%p)\n",
this, hBitmap);
+ HRESULT hr = m_IBanneredBar->SetBitmap(hBitmap);
+ WrapLogExit("CMenuDeskBarWrap::SetBitmap() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::GetBitmap(HBITMAP* phBitmap)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::GetBitmap(HBITMAP*
phBitmap=%p)\n", this, phBitmap);
+ HRESULT hr = m_IBanneredBar->GetBitmap(phBitmap);
+ if (phBitmap) WrapLogMsg("*phBitmap=%p\n", *phBitmap);
+ WrapLogExit("CMenuDeskBarWrap::GetBitmap() = %08x\n", hr);
+ return hr;
+}
+
+
+// *** IInitializeObject methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::Initialize(THIS)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::Initialize()\n", this);
+ HRESULT hr = m_IInitializeObject->Initialize();
+ WrapLogExit("CMenuDeskBarWrap::Initialize() = %08x\n", hr);
+ return hr;
+}
+
+// *** IOleCommandTarget methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::QueryStatus(const GUID *pguidCmdGroup, ULONG
cCmds, OLECMD prgCmds [], OLECMDTEXT *pCmdText)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::QueryStatus(const GUID
*pguidCmdGroup=%p, ULONG cCmds=%u, prgCmds=%p, pCmdText=%p)\n", this, pguidCmdGroup,
cCmds, prgCmds, pCmdText);
+ HRESULT hr = m_IOleCommandTarget->QueryStatus(pguidCmdGroup, cCmds, prgCmds,
pCmdText);
+ if (pguidCmdGroup) WrapLogMsg("*pguidCmdGroup=%s\n",
Wrap(*pguidCmdGroup));
+ WrapLogExit("CMenuDeskBarWrap::QueryStatus() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::Exec(const GUID *pguidCmdGroup, DWORD nCmdID,
DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::Exec(const GUID *pguidCmdGroup=%p,
DWORD nCmdID=%d, DWORD nCmdexecopt=%d, VARIANT *pvaIn=%p, VARIANT *pvaOut=%p)\n",
this, pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn, pvaOut);
+ if (pguidCmdGroup) WrapLogMsg("*pguidCmdGroup=%s\n",
Wrap(*pguidCmdGroup));
+ HRESULT hr = m_IOleCommandTarget->Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn,
pvaOut);
+ WrapLogExit("CMenuDeskBarWrap::Exec() = %08x\n", hr);
+ return hr;
+}
+
+// *** IServiceProvider methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::QueryService(REFGUID guidService, REFIID
riid, void **ppvObject)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::QueryService(REFGUID guidService=%s,
REFIID riid=%s, void **ppvObject=%p)\n", this, Wrap(guidService), Wrap(riid),
ppvObject);
+
+ if (IsEqualIID(guidService, SID_SMenuPopup))
+ {
+ WrapLogMsg("SID is SID_SMenuPopup. Using QueryInterface of self instead of
wrapped object.\n");
+ HRESULT hr = this->QueryInterface(riid, ppvObject);
+ if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
+ if (SUCCEEDED(hr))
+ {
+ WrapLogExit("CMenuDeskBarWrap::QueryService() = %08x\n", hr);
+ return hr;
+ }
+ else
+ {
+ WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
+ }
+ }
+ else if (IsEqualIID(guidService, SID_SMenuBandParent))
+ {
+ WrapLogMsg("SID is SID_SMenuBandParent. Using QueryInterface of self instead
of wrapped object.\n");
+ HRESULT hr = this->QueryInterface(riid, ppvObject);
+ if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
+ if (SUCCEEDED(hr))
+ {
+ WrapLogExit("CMenuDeskBarWrap::QueryService() = %08x\n", hr);
+ return hr;
+ }
+ else
+ {
+ WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
+ }
+ }
+ else if (IsEqualIID(guidService, SID_STopLevelBrowser))
+ {
+ WrapLogMsg("SID is SID_STopLevelBrowser. Using QueryInterface of self
instead of wrapped object.\n");
+ HRESULT hr = this->QueryInterface(riid, ppvObject);
+ if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
+ if (SUCCEEDED(hr))
+ {
+ WrapLogExit("CMenuDeskBarWrap::QueryService() = %08x\n", hr);
+ return hr;
+ }
+ else
+ {
+ WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
+ }
+ }
+ else
+ {
+ WrapLogMsg("SID not identified. Calling wrapped object's
QueryService.\n");
+ }
+ HRESULT hr = m_IServiceProvider->QueryService(guidService, riid, ppvObject);
+ if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
+ WrapLogExit("CMenuDeskBarWrap::QueryService() = %08x\n", hr);
+ return hr;
+}
+
+// *** IInputObjectSite methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::OnFocusChangeIS(LPUNKNOWN lpUnknown, BOOL
bFocus)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::OnFocusChangeIS(LPUNKNOWN
lpUnknown=%p, BOOL bFocus=%d)\n", this, lpUnknown, bFocus);
+ HRESULT hr = m_IInputObjectSite->OnFocusChangeIS(lpUnknown, bFocus);
+ WrapLogExit("CMenuDeskBarWrap::OnFocusChangeIS() = %08x\n", hr);
+ return hr;
+}
+
+// *** IInputObject methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::UIActivateIO(BOOL bActivating, LPMSG lpMsg)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::UIActivateIO(BOOL bActivating=%d,
LPMSG lpMsg=%p)\n", this, bActivating, lpMsg);
+ HRESULT hr = m_IInputObject->UIActivateIO(bActivating, lpMsg);
+ WrapLogExit("CMenuDeskBarWrap::UIActivateIO() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::HasFocusIO(THIS)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::HasFocusIO()\n", this);
+ HRESULT hr = m_IInputObject->HasFocusIO();
+ WrapLogExit("CMenuDeskBarWrap::HasFocusIO() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::TranslateAcceleratorIO(LPMSG lpMsg)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::TranslateAcceleratorIO(LPMSG
lpMsg=%p)\n", this, lpMsg);
+ if (lpMsg) WrapLogMsg("*lpMsg=%s\n", Wrap(*lpMsg));
+ HRESULT hr = m_IInputObject->TranslateAcceleratorIO(lpMsg);
+ WrapLogExit("CMenuDeskBarWrap::TranslateAcceleratorIO() = %08x\n", hr);
+ return hr;
+}
+
+// *** IDeskBar methods ***
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::SetClient(IUnknown *punkClient)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::SetClient(IUnknown
*punkClient=%p)\n", this, punkClient);
+ HRESULT hr = m_IDeskBar->SetClient(punkClient);
+ WrapLogExit("CMenuDeskBarWrap::SetClient() = %08x\n", hr);
+
+ CComPtr<IDeskBarClient> dbc;
+ punkClient->QueryInterface(IID_PPV_ARG(IDeskBarClient, &dbc));
+ dbc->SetDeskBarSite(static_cast<IDeskBar*>(this));
+
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::GetClient(IUnknown **ppunkClient)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::GetClient(IUnknown
**ppunkClient=%p)\n", this, ppunkClient);
+ HRESULT hr = m_IDeskBar->GetClient(ppunkClient);
+ if (ppunkClient) WrapLogMsg("*ppunkClient=%p\n", *ppunkClient);
+ WrapLogExit("CMenuDeskBarWrap::GetClient() = %08x\n", hr);
+ return hr;
+}
+
+HRESULT STDMETHODCALLTYPE CMenuDeskBarWrap::OnPosRectChangeDB(LPRECT prc)
+{
+ WrapLogEnter("CMenuDeskBarWrap<%p>::OnPosRectChangeDB(RECT
*prc=%p)\n", this, prc);
+ HRESULT hr = m_IDeskBar->OnPosRectChangeDB(prc);
+ if (prc) WrapLogMsg("*prc=%s\n", Wrap(*prc));
+ WrapLogExit("CMenuDeskBarWrap::OnPosRectChangeDB() = %08x\n", hr);
+ return hr;
+}
Propchange: branches/shell-experiments/base/shell/rshell/logging/CMenuDeskBarWrap.cpp
------------------------------------------------------------------------------
svn:eol-style = CRLF
Modified: branches/shell-experiments/base/shell/rshell/precomp.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/precomp.h [iso-8859-1] Wed Feb 19
00:20:45 2014
@@ -1,7 +1,11 @@
-#define USE_BUILTIN_MENUDESKBAR
-#define USE_BUILTIN_MENUSITE
-#define USE_BUILTIN_MENUBAND
+#define USE_SYSTEM_MENUDESKBAR 0
+#define USE_SYSTEM_MENUSITE 0
+#define USE_SYSTEM_MENUBAND 0
+
+// if not using system above
+#define WRAP_MENUDESKBAR 0
+#define WRAP_MENUBAND 0
#include <stdio.h>
#include <tchar.h>
@@ -34,6 +38,8 @@
#define SMC_EXEC 4
extern "C" INT WINAPI Shell_GetCachedImageIndex(LPCWSTR szPath, INT nIndex,
UINT bSimulateDoc);
-extern "C" HRESULT CMenuDeskBar_Constructor(REFIID riid, LPVOID *ppv);
extern "C" HRESULT CMenuSite_Constructor(REFIID riid, LPVOID *ppv);
extern "C" HRESULT CMenuBand_Constructor(REFIID riid, LPVOID *ppv);
+extern "C" HRESULT CMenuDeskBar_Constructor(REFIID riid, LPVOID *ppv);
+extern "C" HRESULT CMenuBand_Wrapper(REFIID riid, LPVOID *ppv);
+extern "C" HRESULT CMenuDeskBar_Wrapper(REFIID riid, LPVOID *ppv);