Author: dquintana
Date: Thu Feb 20 12:12:42 2014
New Revision: 62262
URL:
http://svn.reactos.org/svn/reactos?rev=62262&view=rev
Log:
[RSHELL]
* CMenuBand: Implement rudimentary support for changing the hot item with the keyboard
(up/down). The code can probable be simpler, and some corner cases need to be fixed, but
it works.
* CMenuDeskBar: Attempt to redesign OnSelect to better match the windows behaviour, which
is still mostly unknown.
* Make the log results more readable.
CORE-7881
Modified:
branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp
branches/shell-experiments/base/shell/rshell/logging/CMenuBandWrap.cpp
branches/shell-experiments/base/shell/rshell/logging/CMenuDeskBarWrap.cpp
branches/shell-experiments/base/shell/rshell/logging/CMenuSiteWrap.cpp
branches/shell-experiments/base/shell/rshell/wraplog.cpp
branches/shell-experiments/base/shell/rshell/wraplog.h
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] Thu Feb 20
12:12:42 2014
@@ -58,6 +58,8 @@
HRESULT PopupSubMenu(UINT index, HMENU menu);
HRESULT DoContextMenu(IContextMenu* contextMenu);
+ HRESULT ChildTrack(DWORD dwSelectType);
+
static LRESULT CALLBACK s_SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM
lParam);
protected:
@@ -153,6 +155,9 @@
CMenuFocusManager * m_focusManager;
+ CMenuToolbarBase * m_hotBar;
+ INT m_hotItem;
+
public:
// *** IDeskBand methods ***
@@ -241,6 +246,8 @@
HRESULT CallCBWithPidl(LPITEMIDLIST pidl, UINT uMsg, WPARAM wParam, LPARAM lParam);
HRESULT TrackPopup(HMENU popup, INT x, INT y);
HRESULT GetTopLevelWindow(HWND*topLevel);
+ HRESULT OnHotItemChanged(CMenuToolbarBase * tb, INT id);
+ HRESULT ChildTrack(DWORD reason);
BOOL UseBigIcons() {
return m_useBigIcons;
@@ -418,19 +425,19 @@
case VK_MENU:
case VK_LMENU:
case VK_RMENU:
- m_currentBand->OnSelect(MPOS_FULLCANCEL);
+ m_currentBand->ChildTrack(MPOS_FULLCANCEL);
break;
case VK_LEFT:
- m_currentBand->OnSelect(MPOS_SELECTLEFT);
+ m_currentBand->ChildTrack(MPOS_SELECTLEFT);
break;
case VK_RIGHT:
- m_currentBand->OnSelect(MPOS_SELECTRIGHT);
+ m_currentBand->ChildTrack(MPOS_SELECTRIGHT);
break;
case VK_UP:
- //m_currentBand->ChildTrack(VK_UP);
+ m_currentBand->ChildTrack(VK_UP);
break;
case VK_DOWN:
- //m_currentBand->ChildTrack(VK_DOWN);
+ m_currentBand->ChildTrack(VK_DOWN);
break;
}
break;
@@ -676,6 +683,9 @@
if (hot->dwFlags & HICF_LEAVING)
{
KillTimer(m_hwnd, TIMERID_HOTTRACK);
+ m_hotItem = -1;
+ m_menuBand->OnHotItemChanged(NULL, -1);
+ m_menuBand->ChildTrack(MPOS_CHILDTRACKING);
}
else if (m_hotItem != hot->idNew)
{
@@ -684,13 +694,14 @@
DWORD elapsed = 0;
SystemParametersInfo(SPI_GETMENUSHOWDELAY, 0, &elapsed, 0);
- m_hotItem = hot->idNew;
SetTimer(m_hwnd, TIMERID_HOTTRACK, elapsed, NULL);
}
- }
-
- m_menuBand->OnSelect(MPOS_CHILDTRACKING);
+
+ m_hotItem = hot->idNew;
+ m_menuBand->OnHotItemChanged(this, m_hotItem);
+ m_menuBand->ChildTrack(MPOS_CHILDTRACKING);
+ }
return S_OK;
}
@@ -817,6 +828,95 @@
{
m_menuBand->OnSelect(MPOS_EXECUTE);
return S_OK;
+}
+
+
+HRESULT CMenuToolbarBase::ChildTrack(DWORD dwSelectType)
+{
+ int prev = SendMessage(m_hwnd, TB_GETHOTITEM, 0, 0);
+ int index = -1;
+
+ if (dwSelectType != 0xFFFFFFFF)
+ {
+ int count = SendMessage(m_hwnd, TB_BUTTONCOUNT, 0, 0);
+
+ if (m_hotItem >= 0)
+ {
+ TBBUTTONINFO info = { 0 };
+ info.cbSize = sizeof(TBBUTTONINFO);
+ info.dwMask = 0;
+ index = SendMessage(m_hwnd, TB_GETBUTTONINFO, m_hotItem,
reinterpret_cast<LPARAM>(&info));
+ }
+
+ if (dwSelectType == VK_HOME)
+ {
+ index = 0;
+ dwSelectType = VK_DOWN;
+ }
+ else if (dwSelectType == VK_END)
+ {
+ index = count - 1;
+ dwSelectType = VK_UP;
+ }
+ else if (index < 0)
+ {
+ if (dwSelectType == VK_UP)
+ {
+ index = count - 1;
+ }
+ else if (dwSelectType == VK_DOWN)
+ {
+ index = 0;
+ }
+ }
+ else
+ {
+ if (dwSelectType == VK_UP)
+ {
+ index--;
+ }
+ else if (dwSelectType == VK_DOWN)
+ {
+ index++;
+ }
+ }
+
+ TBBUTTON btn = { 0 };
+ while (index >= 0 && index < count)
+ {
+ DWORD res = SendMessage(m_hwnd, TB_GETBUTTON, index,
reinterpret_cast<LPARAM>(&btn));
+ if (!res)
+ return E_FAIL;
+
+ if (btn.dwData)
+ {
+ m_hotItem = btn.idCommand;
+ if (prev != index)
+ {
+ SendMessage(m_hwnd, TB_SETHOTITEM, index, 0);
+ return m_menuBand->OnHotItemChanged(this, m_hotItem);
+ }
+ return S_OK;
+ }
+
+ if (dwSelectType == VK_UP)
+ {
+ index--;
+ }
+ else if (dwSelectType == VK_DOWN)
+ {
+ index++;
+ }
+ }
+ }
+
+ m_hotItem = -1;
+ if (prev != index)
+ {
+ SendMessage(m_hwnd, TB_SETHOTITEM, -1, 0);
+ m_menuBand->OnHotItemChanged(NULL, -1);
+ }
+ return S_FALSE;
}
BOOL
@@ -1026,7 +1126,7 @@
tbb.fsStyle |= BTNS_DROPDOWN;
}
- tbb.idCommand = i++;
+ tbb.idCommand = ++i;
tbb.iString = (INT_PTR) MenuString;
tbb.iBitmap = index;
tbb.dwData = reinterpret_cast<DWORD_PTR>(ILClone(item));
@@ -1187,7 +1287,9 @@
m_psmc(NULL),
m_staticToolbar(NULL),
m_SFToolbar(NULL),
- m_useBigIcons(FALSE)
+ m_useBigIcons(FALSE),
+ m_hotBar(NULL),
+ m_hotItem(-1)
{
m_focusManager = CMenuFocusManager::AcquireManager();
}
@@ -1561,25 +1663,31 @@
HRESULT STDMETHODCALLTYPE CMenuBand::UIActivateIO(BOOL fActivate, LPMSG lpMsg)
{
HRESULT hr;
-
CComPtr<IMenuPopup> pmp;
hr = IUnknown_QueryService(m_site, SID_SMenuPopup, IID_PPV_ARG(IMenuPopup,
&pmp));
if (FAILED(hr))
return hr;
- hr = pmp->SetSubMenu(this, TRUE);
- if (FAILED(hr))
- return hr;
-
- CComPtr<IOleWindow> pTopLevelWindow;
- hr = IUnknown_QueryService(m_site, SID_SMenuPopup, IID_PPV_ARG(IOleWindow,
&pTopLevelWindow));
- if (FAILED(hr))
- return hr;
-
- hr = pTopLevelWindow->GetWindow(&m_topLevelWindow);
- if (FAILED(hr))
- return hr;
+ hr = pmp->SetSubMenu(this, fActivate);
+ if (FAILED(hr))
+ return hr;
+
+ if (fActivate)
+ {
+ CComPtr<IOleWindow> pTopLevelWindow;
+ hr = IUnknown_QueryService(m_site, SID_SMenuPopup, IID_PPV_ARG(IOleWindow,
&pTopLevelWindow));
+ if (FAILED(hr))
+ return hr;
+
+ hr = pTopLevelWindow->GetWindow(&m_topLevelWindow);
+ if (FAILED(hr))
+ return hr;
+ }
+ else
+ {
+ m_topLevelWindow = NULL;
+ }
return S_FALSE;
}
@@ -1672,11 +1780,6 @@
HRESULT STDMETHODCALLTYPE CMenuBand::OnSelect(DWORD dwSelectType)
{
- CComPtr<IMenuPopup> pmp;
- HRESULT hr = IUnknown_QueryService(m_site, SID_SMenuPopup, IID_PPV_ARG(IMenuPopup,
&pmp));
- if (FAILED(hr))
- return hr;
- pmp->OnSelect(dwSelectType);
return S_OK;
}
@@ -1998,4 +2101,81 @@
{
*topLevel = m_topLevelWindow;
return S_OK;
-}
+}
+
+HRESULT CMenuBand::OnHotItemChanged(CMenuToolbarBase * tb, INT id)
+{
+ if (m_hotBar && m_hotBar != tb)
+ m_hotBar->ChildTrack(-1);
+ m_hotBar = tb;
+ m_hotItem = id;
+ return S_OK;
+}
+
+HRESULT CMenuBand::ChildTrack(DWORD dwSelectType)
+{
+ HRESULT hr;
+ if (dwSelectType == VK_DOWN)
+ {
+ if (m_SFToolbar && (m_hotBar == m_SFToolbar || m_hotBar == NULL))
+ {
+ hr = m_SFToolbar->ChildTrack(dwSelectType);
+ if (hr == S_FALSE)
+ {
+ if (m_staticToolbar)
+ return m_staticToolbar->ChildTrack(VK_HOME);
+ else
+ return m_SFToolbar->ChildTrack(VK_HOME);
+ }
+ return hr;
+ }
+ else if (m_staticToolbar && m_hotBar == m_staticToolbar)
+ {
+ hr = m_staticToolbar->ChildTrack(dwSelectType);
+ if (hr == S_FALSE)
+ {
+ if (m_SFToolbar)
+ return m_SFToolbar->ChildTrack(VK_HOME);
+ else
+ return m_staticToolbar->ChildTrack(VK_HOME);
+ }
+ return hr;
+ }
+ }
+ else if (dwSelectType == VK_UP)
+ {
+ if (m_staticToolbar && (m_hotBar == m_staticToolbar || m_hotBar ==
NULL))
+ {
+ hr = m_staticToolbar->ChildTrack(dwSelectType);
+ if (hr == S_FALSE)
+ {
+ if (m_SFToolbar)
+ return m_SFToolbar->ChildTrack(VK_END);
+ else
+ return m_staticToolbar->ChildTrack(VK_END);
+ }
+ return hr;
+ }
+ else if (m_SFToolbar && m_hotBar == m_SFToolbar)
+ {
+ hr = m_SFToolbar->ChildTrack(dwSelectType);
+ if (hr == S_FALSE)
+ {
+ if (m_staticToolbar)
+ return m_staticToolbar->ChildTrack(VK_END);
+ else
+ return m_SFToolbar->ChildTrack(VK_END);
+ }
+ return hr;
+ }
+ }
+ else
+ {
+ CComPtr<IMenuPopup> pmp;
+ hr = IUnknown_QueryService(m_site, SID_SMenuPopup, IID_PPV_ARG(IMenuPopup,
&pmp));
+ if (FAILED(hr))
+ return hr;
+ pmp->OnSelect(dwSelectType);
+ }
+ 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] Thu Feb 20
12:12:42 2014
@@ -228,9 +228,6 @@
HRESULT STDMETHODCALLTYPE CMenuDeskBar::QueryService(REFGUID guidService, REFIID riid,
void **ppvObject)
{
- if (m_Site == NULL)
- return E_FAIL;
-
if (IsEqualGUID(guidService, SID_SMenuPopup) ||
IsEqualGUID(guidService, SID_SMenuBandParent) ||
IsEqualGUID(guidService, SID_STopLevelBrowser))
@@ -238,6 +235,9 @@
return this->QueryInterface(riid, ppvObject);
}
+ if (m_Site == NULL)
+ return E_NOINTERFACE;
+
return IUnknown_QueryService(m_Site, guidService, riid, ppvObject);
}
@@ -333,8 +333,6 @@
LRESULT CMenuDeskBar::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled)
{
- HRESULT hr;
-
if (m_Client)
{
RECT rc;
@@ -538,31 +536,13 @@
{
CComPtr<IDeskBarClient> dbc;
HRESULT hr;
-
- bool bubbleUp = false;
- bool cancel = false;
switch (dwSelectType)
{
+ case MPOS_EXECUTE:
case MPOS_FULLCANCEL:
- case MPOS_EXECUTE:
- bubbleUp = true;
- cancel = true;
- break;
case MPOS_CANCELLEVEL:
- cancel = true;
- break;
- case MPOS_SELECTLEFT:
- case MPOS_SELECTRIGHT:
- // if unhandled, spread upwards?
- bubbleUp = true;
- break;
- case MPOS_CHILDTRACKING:
- break;
- }
-
- if (cancel)
- {
+
hr = m_Client->QueryInterface(IID_PPV_ARG(IDeskBarClient, &dbc));
if (FAILED(hr))
return hr;
@@ -574,12 +554,23 @@
SetWindowPos(m_hWnd, 0, 0, 0, 0, SWP_HIDEWINDOW | SWP_NOACTIVATE | SWP_NOMOVE |
SWP_NOZORDER);
UIActivateIO(FALSE, NULL);
- }
-
- if (bubbleUp && m_SubMenuParent)
- {
- hr = m_SubMenuParent->OnSelect(MPOS_CANCELLEVEL); // why??
- return hr;
+
+ if (dwSelectType == MPOS_CANCELLEVEL)
+ break;
+
+ dwSelectType = MPOS_CANCELLEVEL;
+ case MPOS_SELECTLEFT:
+ case MPOS_SELECTRIGHT:
+ /*CComPtr<IMenuPopup> pmp;
+ hr = IUnknown_QueryService(m_Client, SID_SMenuBandChild, IID_PPV_ARG(IMenuPopup,
&pmp));
+ if (FAILED(hr))
+ return hr;*/
+
+ hr = m_SubMenuParent->OnSelect(dwSelectType);
+ if (FAILED(hr))
+ return hr;
+ case MPOS_CHILDTRACKING:
+ break;
}
return S_OK;
Modified: 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 [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/logging/CMenuBandWrap.cpp [iso-8859-1]
Thu Feb 20 12:12:42 2014
@@ -60,6 +60,8 @@
CComPtr<IShellMenu > m_IShellMenu;
CComPtr<IWinEventHandler > m_IWinEventHandler;
CComPtr<IShellMenuAcc > m_IShellMenuAcc;
+
+ IUnknown * m_site;
public:
@@ -247,7 +249,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::GetSubMenu()\n", this);
HRESULT hr = m_IShellMenu2->GetSubMenu();
- WrapLogExit("CMenuBandWrap::GetSubMenu() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::GetSubMenu()", hr);
return hr;
}
@@ -255,7 +257,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::SetToolbar()\n", this);
HRESULT hr = m_IShellMenu2->SetToolbar();
- WrapLogExit("CMenuBandWrap::SetToolbar() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::SetToolbar()", hr);
return hr;
}
@@ -263,7 +265,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::SetMinWidth()\n", this);
HRESULT hr = m_IShellMenu2->SetMinWidth();
- WrapLogExit("CMenuBandWrap::SetMinWidth() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::SetMinWidth()", hr);
return hr;
}
@@ -271,7 +273,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::SetNoBorder()\n", this);
HRESULT hr = m_IShellMenu2->SetNoBorder();
- WrapLogExit("CMenuBandWrap::SetNoBorder() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::SetNoBorder()", hr);
return hr;
}
@@ -279,7 +281,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::SetTheme()\n", this);
HRESULT hr = m_IShellMenu2->SetTheme();
- WrapLogExit("CMenuBandWrap::SetTheme() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::SetTheme()", hr);
return hr;
}
@@ -289,7 +291,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::GetTop()\n", this);
HRESULT hr = m_IShellMenuAcc->GetTop();
- WrapLogExit("CMenuBandWrap::GetTop() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::GetTop()", hr);
return hr;
}
@@ -297,7 +299,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
HRESULT hr = m_IShellMenuAcc->GetBottom();
- WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::GetBottom()", hr);
return hr;
}
@@ -305,7 +307,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
HRESULT hr = m_IShellMenuAcc->GetBottom();
- WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::GetBottom()", hr);
return hr;
}
@@ -313,7 +315,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
HRESULT hr = m_IShellMenuAcc->GetBottom();
- WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::GetBottom()", hr);
return hr;
}
@@ -321,7 +323,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
HRESULT hr = m_IShellMenuAcc->GetBottom();
- WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::GetBottom()", hr);
return hr;
}
@@ -329,7 +331,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
HRESULT hr = m_IShellMenuAcc->GetBottom();
- WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::GetBottom()", hr);
return hr;
}
@@ -337,7 +339,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::GetBottom()\n", this);
HRESULT hr = m_IShellMenuAcc->GetBottom();
- WrapLogExit("CMenuBandWrap::GetBottom() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::GetBottom()", hr);
return hr;
}
@@ -346,7 +348,7 @@
{
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);
+ WrapLogExit("CMenuBandWrap::GetBandInfo()", hr);
return hr;
}
@@ -355,7 +357,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::ShowDW(BOOL fShow=%d)\n", this,
fShow);
HRESULT hr = m_IDockingWindow->ShowDW(fShow);
- WrapLogExit("CMenuBandWrap::ShowDW() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::ShowDW()", hr);
return hr;
}
@@ -363,17 +365,17 @@
{
WrapLogEnter("CMenuBandWrap<%p>::CloseDW(DWORD dwReserved=%d)\n",
this, dwReserved);
HRESULT hr = m_IDockingWindow->CloseDW(dwReserved);
- WrapLogExit("CMenuBandWrap::CloseDW() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::CloseDW()", 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));
+ if (prcBorder) WrapLogPre("*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);
+ if (prcBorder) WrapLogPost("*prcBorder=%s\n", Wrap(*prcBorder));
+ WrapLogExit("CMenuBandWrap::ResizeBorderDW()", hr);
return hr;
}
@@ -382,15 +384,15 @@
{
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);
+ if (phwnd) WrapLogPost("*phwnd=%p\n", *phwnd);
+ WrapLogExit("CMenuBandWrap::GetWindow()", 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);
+ WrapLogExit("CMenuBandWrap::ContextSensitiveHelp()", hr);
return hr;
}
@@ -399,7 +401,7 @@
{
//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);
+ //WrapLogExit("CMenuBandWrap::OnWinEvent()", hr);
return hr;
}
@@ -407,7 +409,7 @@
{
//WrapLogEnter("CMenuBandWrap<%p>::IsWindowOwner(HWND hWnd=%08x)\n",
this, hWnd);
HRESULT hr = m_IWinEventHandler->IsWindowOwner(hWnd);
- //WrapLogExit("CMenuBandWrap::IsWindowOwner() = %08x\n", hr);
+ //WrapLogExit("CMenuBandWrap::IsWindowOwner()", hr);
return hr;
}
@@ -416,7 +418,8 @@
{
WrapLogEnter("CMenuBandWrap<%p>::SetSite(IUnknown *pUnkSite=%p)\n",
this, pUnkSite);
HRESULT hr = m_IObjectWithSite->SetSite(pUnkSite);
- WrapLogExit("CMenuBandWrap::SetSite() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::SetSite()", hr);
+ m_site = pUnkSite;
return hr;
}
@@ -424,8 +427,8 @@
{
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);
+ if (ppvSite) WrapLogPost("*ppvSite=%p\n", *ppvSite);
+ WrapLogExit("CMenuBandWrap::GetSite()", hr);
return hr;
}
@@ -434,7 +437,17 @@
{
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);
+ WrapLogExit("CMenuBandWrap::UIActivateIO()", hr);
+
+ HRESULT hrt;
+ CComPtr<IMenuPopup> pmp;
+
+ hrt = IUnknown_QueryService(m_site, SID_SMenuPopup, IID_PPV_ARG(IMenuPopup,
&pmp));
+ if (FAILED(hrt))
+ return hr;
+
+ hrt = pmp->SetSubMenu(this, fActivate);
+
return hr;
}
@@ -442,16 +455,16 @@
{
WrapLogEnter("CMenuBandWrap<%p>::HasFocusIO()\n", this);
HRESULT hr = m_IInputObject->HasFocusIO();
- WrapLogExit("CMenuBandWrap::HasFocusIO() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::HasFocusIO()", 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));
+ if (lpMsg) WrapLogPre("*lpMsg=%s\n", Wrap(*lpMsg));
HRESULT hr = m_IInputObject->TranslateAcceleratorIO(lpMsg);
- WrapLogExit("CMenuBandWrap::TranslateAcceleratorIO() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::TranslateAcceleratorIO()", hr);
return hr;
}
@@ -460,28 +473,28 @@
{
WrapLogEnter("CMenuBandWrap<%p>::IsDirty()\n", this);
HRESULT hr = m_IPersistStream->IsDirty();
- WrapLogExit("CMenuBandWrap::IsDirty() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::IsDirty()", 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);
+ WrapLogExit("CMenuBandWrap::Load()", 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);
+ WrapLogExit("CMenuBandWrap::Save()", 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);
+ WrapLogExit("CMenuBandWrap::GetSizeMax()", hr);
return hr;
}
@@ -490,8 +503,8 @@
{
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);
+ if (pClassID) WrapLogPost("*pClassID=%s\n", Wrap(*pClassID));
+ WrapLogExit("CMenuBandWrap::GetClassID()", hr);
return hr;
}
@@ -500,17 +513,17 @@
{
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);
+ if (pguidCmdGroup) WrapLogPost("*pguidCmdGroup=%s\n",
Wrap(*pguidCmdGroup));
+ WrapLogExit("CMenuBandWrap::QueryStatus()", 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));
+ if (pguidCmdGroup) WrapLogPre("*pguidCmdGroup=%s\n",
Wrap(*pguidCmdGroup));
HRESULT hr = m_IOleCommandTarget->Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn,
pvaOut);
- WrapLogExit("CMenuBandWrap::Exec() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::Exec()", hr);
return hr;
}
@@ -521,56 +534,56 @@
if (IsEqualIID(guidService, SID_SMenuBandChild))
{
- WrapLogMsg("SID is SID_SMenuBandChild. Using QueryInterface of self instead
of wrapped object.\n");
+ WrapLogPre("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);
+ if (ppvObject) WrapLogPost("*ppvObject=%p\n", *ppvObject);
+ WrapLogExit("CMenuBandWrap::QueryService()", hr);
return hr;
}
else
{
- WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
+ WrapLogPre("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");
+ WrapLogPre("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);
+ if (ppvObject) WrapLogPost("*ppvObject=%p\n", *ppvObject);
+ WrapLogExit("CMenuBandWrap::QueryService()", hr);
return hr;
}
else
{
- WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
+ WrapLogPre("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");
+ WrapLogPre("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);
+ if (ppvObject) WrapLogPost("*ppvObject=%p\n", *ppvObject);
+ WrapLogExit("CMenuBandWrap::QueryService()", hr);
return hr;
}
else
{
- WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
+ WrapLogPre("QueryInterface on wrapper failed. Handing over to innter
object.\n");
}
}
else
{
- WrapLogMsg("SID not identified.\n");
+ WrapLogPre("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);
+ if (ppvObject) WrapLogPost("*ppvObject=%p\n", *ppvObject);
+ WrapLogExit("CMenuBandWrap::QueryService()", hr);
return hr;
}
@@ -580,7 +593,7 @@
{
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);
+ WrapLogExit("CMenuBandWrap::Popup()", hr);
return hr;
}
@@ -588,7 +601,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::OnSelect(DWORD
dwSelectType=%08x)\n", this, dwSelectType);
HRESULT hr = m_IMenuPopup->OnSelect(dwSelectType);
- WrapLogExit("CMenuBandWrap::OnSelect() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::OnSelect()", hr);
return hr;
}
@@ -596,7 +609,7 @@
{
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);
+ WrapLogExit("CMenuBandWrap::SetSubMenu()", hr);
return hr;
}
@@ -606,7 +619,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::SetClient(IUnknown
*punkClient=%p)\n", this, punkClient);
HRESULT hr = m_IDeskBar->SetClient(punkClient);
- WrapLogExit("CMenuBandWrap::SetClient() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::SetClient()", hr);
return hr;
}
@@ -614,8 +627,8 @@
{
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);
+ if (ppunkClient) WrapLogPost("*ppunkClient=%p\n", *ppunkClient);
+ WrapLogExit("CMenuBandWrap::GetClient()", hr);
return hr;
}
@@ -623,8 +636,8 @@
{
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);
+ if (prc) WrapLogPost("*prc=%s\n", Wrap(*prc));
+ WrapLogExit("CMenuBandWrap::OnPosRectChangeDB()", hr);
return hr;
}
@@ -634,7 +647,7 @@
{
//WrapLogEnter("CMenuBandWrap<%p>::IsMenuMessage(MSG *pmsg=%p)\n",
this, pmsg);
HRESULT hr = m_IMenuBand->IsMenuMessage(pmsg);
- //WrapLogExit("CMenuBandWrap::IsMenuMessage() = %08x\n", hr);
+ //WrapLogExit("CMenuBandWrap::IsMenuMessage()", hr);
return hr;
}
@@ -651,7 +664,7 @@
{
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);
+ WrapLogExit("CMenuBandWrap::Initialize()", hr);
return hr;
}
@@ -659,11 +672,11 @@
{
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);
+ if (ppsmc) WrapLogPost("*ppsmc=%p\n", *ppsmc);
+ if (puId) WrapLogPost("*puId=%u\n", *puId);
+ if (puIdAncestor) WrapLogPost("*puIdAncestor=%u\n", *puIdAncestor);
+ if (pdwFlags) WrapLogPost("*pdwFlags=%08x\n", *pdwFlags);
+ WrapLogExit("CMenuBandWrap::GetMenuInfo()", hr);
return hr;
}
@@ -671,7 +684,7 @@
{
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);
+ WrapLogExit("CMenuBandWrap::SetShellFolder()", hr);
return hr;
}
@@ -679,10 +692,10 @@
{
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);
+ if (pdwFlags) WrapLogPost("*pdwFlags=%08x\n", *pdwFlags);
+ if (ppidl) WrapLogPost("*ppidl=%p\n", *ppidl);
+ if (ppv) WrapLogPost("*ppv=%p\n", *ppv);
+ WrapLogExit("CMenuBandWrap::GetShellFolder()", hr);
return hr;
}
@@ -690,7 +703,7 @@
{
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);
+ WrapLogExit("CMenuBandWrap::SetMenu()", hr);
return hr;
}
@@ -698,10 +711,10 @@
{
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);
+ if (phmenu) WrapLogPost("*phmenu=%p\n", *phmenu);
+ if (phwnd) WrapLogPost("*phwnd=%p\n", *phwnd);
+ if (pdwFlags) WrapLogPost("*pdwFlags=%08x\n", *pdwFlags);
+ WrapLogExit("CMenuBandWrap::GetMenu()", hr);
return hr;
}
@@ -709,7 +722,7 @@
{
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);
+ WrapLogExit("CMenuBandWrap::InvalidateItem()", hr);
return hr;
}
@@ -717,7 +730,7 @@
{
WrapLogEnter("CMenuBandWrap<%p>::GetState(LPSMDATA psmd=%p)\n", this,
psmd);
HRESULT hr = m_IShellMenu->GetState(psmd);
- WrapLogExit("CMenuBandWrap::GetState() = %08x\n", hr);
+ WrapLogExit("CMenuBandWrap::GetState()", hr);
return hr;
}
@@ -725,6 +738,6 @@
{
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;
-}
+ WrapLogExit("CMenuBandWrap::SetMenuToolbar()", hr);
+ return hr;
+}
Modified: 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 [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/logging/CMenuDeskBarWrap.cpp [iso-8859-1]
Thu Feb 20 12:12:42 2014
@@ -174,7 +174,7 @@
{
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);
+ WrapLogExit("CMenuDeskBarWrap::Popup()", hr);
return hr;
}
@@ -182,7 +182,7 @@
{
WrapLogEnter("CMenuDeskBarWrap<%p>::OnSelect(DWORD
dwSelectType=%08x)\n", this, dwSelectType);
HRESULT hr = m_IMenuPopup->OnSelect(dwSelectType);
- WrapLogExit("CMenuDeskBarWrap::OnSelect() = %08x\n", hr);
+ WrapLogExit("CMenuDeskBarWrap::OnSelect()", hr);
return hr;
}
@@ -190,7 +190,7 @@
{
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);
+ WrapLogExit("CMenuDeskBarWrap::SetSubMenu()", hr);
return hr;
}
@@ -199,8 +199,8 @@
{
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);
+ if (phwnd) WrapLogPost("*phwnd=%p\n", *phwnd);
+ WrapLogExit("CMenuDeskBarWrap::GetWindow()", hr);
return hr;
}
@@ -208,7 +208,7 @@
{
WrapLogEnter("CMenuDeskBarWrap<%p>::ContextSensitiveHelp(BOOL
fEnterMode=%d)\n", this, fEnterMode);
HRESULT hr = m_IOleWindow->ContextSensitiveHelp(fEnterMode);
- WrapLogExit("CMenuDeskBarWrap::ContextSensitiveHelp() = %08x\n", hr);
+ WrapLogExit("CMenuDeskBarWrap::ContextSensitiveHelp()", hr);
return hr;
}
@@ -217,7 +217,7 @@
{
WrapLogEnter("CMenuDeskBarWrap<%p>::SetSite(IUnknown
*pUnkSite=%p)\n", this, pUnkSite);
HRESULT hr = m_IObjectWithSite->SetSite(pUnkSite);
- WrapLogExit("CMenuDeskBarWrap::SetSite() = %08x\n", hr);
+ WrapLogExit("CMenuDeskBarWrap::SetSite()", hr);
return hr;
}
@@ -225,8 +225,8 @@
{
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);
+ if (ppvSite) WrapLogPost("*ppvSite=%p\n", *ppvSite);
+ WrapLogExit("CMenuDeskBarWrap::GetSite()", hr);
return hr;
}
@@ -235,7 +235,7 @@
{
WrapLogEnter("CMenuDeskBarWrap<%p>::SetIconSize(DWORD iIcon=%d)\n",
this, iIcon);
HRESULT hr = m_IBanneredBar->SetIconSize(iIcon);
- WrapLogExit("CMenuDeskBarWrap::SetIconSize() = %08x\n", hr);
+ WrapLogExit("CMenuDeskBarWrap::SetIconSize()", hr);
return hr;
}
@@ -243,8 +243,8 @@
{
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);
+ if (piIcon) WrapLogPost("*piIcon=%d\n", *piIcon);
+ WrapLogExit("CMenuDeskBarWrap::GetIconSize()", hr);
return hr;
}
@@ -252,7 +252,7 @@
{
WrapLogEnter("CMenuDeskBarWrap<%p>::SetBitmap(HBITMAP hBitmap=%p)\n",
this, hBitmap);
HRESULT hr = m_IBanneredBar->SetBitmap(hBitmap);
- WrapLogExit("CMenuDeskBarWrap::SetBitmap() = %08x\n", hr);
+ WrapLogExit("CMenuDeskBarWrap::SetBitmap()", hr);
return hr;
}
@@ -260,8 +260,8 @@
{
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);
+ if (phBitmap) WrapLogPost("*phBitmap=%p\n", *phBitmap);
+ WrapLogExit("CMenuDeskBarWrap::GetBitmap()", hr);
return hr;
}
@@ -271,7 +271,7 @@
{
WrapLogEnter("CMenuDeskBarWrap<%p>::Initialize()\n", this);
HRESULT hr = m_IInitializeObject->Initialize();
- WrapLogExit("CMenuDeskBarWrap::Initialize() = %08x\n", hr);
+ WrapLogExit("CMenuDeskBarWrap::Initialize()", hr);
return hr;
}
@@ -280,17 +280,17 @@
{
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);
+ if (pguidCmdGroup) WrapLogPost("*pguidCmdGroup=%s\n",
Wrap(*pguidCmdGroup));
+ WrapLogExit("CMenuDeskBarWrap::QueryStatus()", 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));
+ if (pguidCmdGroup) WrapLogPost("*pguidCmdGroup=%s\n",
Wrap(*pguidCmdGroup));
HRESULT hr = m_IOleCommandTarget->Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn,
pvaOut);
- WrapLogExit("CMenuDeskBarWrap::Exec() = %08x\n", hr);
+ WrapLogExit("CMenuDeskBarWrap::Exec()", hr);
return hr;
}
@@ -301,56 +301,56 @@
if (IsEqualIID(guidService, SID_SMenuPopup))
{
- WrapLogMsg("SID is SID_SMenuPopup. Using QueryInterface of self instead of
wrapped object.\n");
+ WrapLogPre("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);
+ if (ppvObject) WrapLogPost("*ppvObject=%p\n", *ppvObject);
+ WrapLogExit("CMenuDeskBarWrap::QueryService()", hr);
return hr;
}
else
{
- WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
+ WrapLogPre("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");
+ WrapLogPre("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);
+ if (ppvObject) WrapLogPost("*ppvObject=%p\n", *ppvObject);
+ WrapLogExit("CMenuDeskBarWrap::QueryService()", hr);
return hr;
}
else
{
- WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
+ WrapLogPre("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");
+ WrapLogPre("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);
+ if (ppvObject) WrapLogPost("*ppvObject=%p\n", *ppvObject);
+ WrapLogExit("CMenuDeskBarWrap::QueryService()", hr);
return hr;
}
else
{
- WrapLogMsg("QueryInterface on wrapper failed. Handing over to innter
object.\n");
+ WrapLogPre("QueryInterface on wrapper failed. Handing over to innter
object.\n");
}
}
else
{
- WrapLogMsg("SID not identified. Calling wrapped object's
QueryService.\n");
+ WrapLogPre("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);
+ if (ppvObject) WrapLogPost("*ppvObject=%p\n", *ppvObject);
+ WrapLogExit("CMenuDeskBarWrap::QueryService()", hr);
return hr;
}
@@ -359,7 +359,7 @@
{
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);
+ WrapLogExit("CMenuDeskBarWrap::OnFocusChangeIS()", hr);
return hr;
}
@@ -368,7 +368,7 @@
{
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);
+ WrapLogExit("CMenuDeskBarWrap::UIActivateIO()", hr);
return hr;
}
@@ -376,16 +376,16 @@
{
WrapLogEnter("CMenuDeskBarWrap<%p>::HasFocusIO()\n", this);
HRESULT hr = m_IInputObject->HasFocusIO();
- WrapLogExit("CMenuDeskBarWrap::HasFocusIO() = %08x\n", hr);
+ WrapLogExit("CMenuDeskBarWrap::HasFocusIO()", 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));
+ if (lpMsg) WrapLogPre("*lpMsg=%s\n", Wrap(*lpMsg));
HRESULT hr = m_IInputObject->TranslateAcceleratorIO(lpMsg);
- WrapLogExit("CMenuDeskBarWrap::TranslateAcceleratorIO() = %08x\n", hr);
+ WrapLogExit("CMenuDeskBarWrap::TranslateAcceleratorIO()", hr);
return hr;
}
@@ -394,7 +394,7 @@
{
WrapLogEnter("CMenuDeskBarWrap<%p>::SetClient(IUnknown
*punkClient=%p)\n", this, punkClient);
HRESULT hr = m_IDeskBar->SetClient(punkClient);
- WrapLogExit("CMenuDeskBarWrap::SetClient() = %08x\n", hr);
+ WrapLogExit("CMenuDeskBarWrap::SetClient()", hr);
CComPtr<IDeskBarClient> dbc;
punkClient->QueryInterface(IID_PPV_ARG(IDeskBarClient, &dbc));
@@ -407,8 +407,8 @@
{
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);
+ if (ppunkClient) WrapLogPost("*ppunkClient=%p\n", *ppunkClient);
+ WrapLogExit("CMenuDeskBarWrap::GetClient()", hr);
return hr;
}
@@ -416,7 +416,7 @@
{
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;
-}
+ if (prc) WrapLogPost("*prc=%s\n", Wrap(*prc));
+ WrapLogExit("CMenuDeskBarWrap::OnPosRectChangeDB()", hr);
+ return hr;
+}
Modified: branches/shell-experiments/base/shell/rshell/logging/CMenuSiteWrap.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/logging/CMenuSiteWrap.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/logging/CMenuSiteWrap.cpp [iso-8859-1]
Thu Feb 20 12:12:42 2014
@@ -165,7 +165,7 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::AddBand(IUnknown * punk=%p)\n",
this, punk);
HRESULT hr = m_IBandSite->AddBand(punk);
- WrapLogExit("CMenuSiteWrap::AddBand() = %08x\n", hr);
+ WrapLogExit("CMenuSiteWrap::AddBand()", hr);
return hr;
}
@@ -173,8 +173,8 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::EnumBands(UINT uBand=%u, DWORD*
pdwBandID=%p)\n", this, uBand, pdwBandID);
HRESULT hr = m_IBandSite->EnumBands(uBand, pdwBandID);
- if (pdwBandID) WrapLogMsg("*pdwBandID=%d\n", *pdwBandID);
- WrapLogExit("CMenuSiteWrap::EnumBands() = %08x\n", hr);
+ if (pdwBandID) WrapLogPost("*pdwBandID=%d\n", *pdwBandID);
+ WrapLogExit("CMenuSiteWrap::EnumBands()", hr);
return hr;
}
@@ -182,9 +182,9 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::QueryBand(DWORD dwBandID=%d, IDeskBand
**ppstb=%p, DWORD *pdwState=%p, LPWSTR pszName=%p, int cchName=%p)\n", this,
dwBandID, ppstb, pdwState, pszName, cchName);
HRESULT hr = m_IBandSite->QueryBand(dwBandID, ppstb, pdwState, pszName, cchName);
- if (ppstb) WrapLogMsg("*ppstb=%p\n", *ppstb);
- if (pdwState) WrapLogMsg("*pdwState=%d\n", *pdwState);
- WrapLogExit("CMenuSiteWrap::QueryBand() = %08x\n", hr);
+ if (ppstb) WrapLogPost("*ppstb=%p\n", *ppstb);
+ if (pdwState) WrapLogPost("*pdwState=%d\n", *pdwState);
+ WrapLogExit("CMenuSiteWrap::QueryBand()", hr);
return hr;
}
@@ -192,8 +192,8 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::GetBandObject(DWORD dwBandID, REFIID
riid, VOID **ppv)\n", this, dwBandID, riid, ppv);
HRESULT hr = m_IBandSite->GetBandObject(dwBandID, riid, ppv);
- if (ppv) WrapLogMsg("*ppv=%p\n", *ppv);
- WrapLogExit("CMenuSiteWrap::GetBandObject() = %08x\n", hr);
+ if (ppv) WrapLogPost("*ppv=%p\n", *ppv);
+ WrapLogExit("CMenuSiteWrap::GetBandObject()", hr);
return hr;
}
@@ -201,8 +201,8 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::GetBandSiteInfo(BANDSITEINFO
*pbsinfo=%p)\n", this, pbsinfo);
HRESULT hr = m_IBandSite->GetBandSiteInfo(pbsinfo);
- if (pbsinfo) WrapLogMsg("*pbsinfo=%p\n", *pbsinfo);
- WrapLogExit("CMenuSiteWrap::GetBandSiteInfo() = %08x\n", hr);
+ if (pbsinfo) WrapLogPost("*pbsinfo=%p\n", *pbsinfo);
+ WrapLogExit("CMenuSiteWrap::GetBandSiteInfo()", hr);
return hr;
}
@@ -210,16 +210,16 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::RemoveBand(DWORD dwBandID=%d)\n",
this, dwBandID);
HRESULT hr = m_IBandSite->RemoveBand(dwBandID);
- WrapLogExit("CMenuSiteWrap::RemoveBand() = %08x\n", hr);
+ WrapLogExit("CMenuSiteWrap::RemoveBand()", hr);
return hr;
}
HRESULT STDMETHODCALLTYPE CMenuSiteWrap::SetBandSiteInfo(const BANDSITEINFO *pbsinfo)
{
WrapLogEnter("CMenuSiteWrap<%p>::SetBandSiteInfo(const BANDSITEINFO
*pbsinfo=%p)\n", this, pbsinfo);
- //if (phwnd) WrapLogMsg("*pbsinfo=%s\n", Wrap(*pbsinfo));
+ //if (phwnd) WrapLogPost("*pbsinfo=%s\n", Wrap(*pbsinfo));
HRESULT hr = m_IBandSite->SetBandSiteInfo(pbsinfo);
- WrapLogExit("CMenuSiteWrap::SetBandSiteInfo() = %08x\n", hr);
+ WrapLogExit("CMenuSiteWrap::SetBandSiteInfo()", hr);
return hr;
}
@@ -227,7 +227,7 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::SetBandState(DWORD dwBandID=%d, DWORD
dwMask=%08x, DWORD dwState=%d)\n", this, dwBandID, dwMask, dwState);
HRESULT hr = m_IBandSite->SetBandState(dwBandID, dwMask, dwState);
- WrapLogExit("CMenuSiteWrap::SetBandState() = %08x\n", hr);
+ WrapLogExit("CMenuSiteWrap::SetBandState()", hr);
return hr;
}
@@ -236,8 +236,8 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::SetDeskBarSite(IUnknown
*punkSite=%p)\n", this, punkSite);
HRESULT hr = m_IDeskBarClient->SetDeskBarSite(punkSite);
- if (punkSite) WrapLogMsg("*punkSite=%p\n", *punkSite);
- WrapLogExit("CMenuSiteWrap::SetDeskBarSite() = %08x\n", hr);
+ if (punkSite) WrapLogPost("*punkSite=%p\n", *punkSite);
+ WrapLogExit("CMenuSiteWrap::SetDeskBarSite()", hr);
return hr;
}
@@ -245,7 +245,7 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::SetModeDBC(DWORD dwMode=%d)\n",
this, dwMode);
HRESULT hr = m_IDeskBarClient->SetModeDBC(dwMode);
- WrapLogExit("CMenuSiteWrap::SetModeDBC() = %08x\n", hr);
+ WrapLogExit("CMenuSiteWrap::SetModeDBC()", hr);
return hr;
}
@@ -253,8 +253,8 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::GetSize(DWORD dwWhich=%d, LPRECT
prc=%p)\n", this, dwWhich, prc);
HRESULT hr = m_IDeskBarClient->GetSize(dwWhich, prc);
- if (prc) WrapLogMsg("*prc=%s\n", Wrap(*prc));
- WrapLogExit("CMenuSiteWrap::GetSize() = %08x\n", hr);
+ if (prc) WrapLogPost("*prc=%s\n", Wrap(*prc));
+ WrapLogExit("CMenuSiteWrap::GetSize()", hr);
return hr;
}
@@ -262,7 +262,7 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::UIActivateDBC(DWORD dwState=%d)\n",
this, dwState);
HRESULT hr = m_IDeskBarClient->UIActivateDBC(dwState);
- WrapLogExit("CMenuSiteWrap::UIActivateDBC() = %08x\n", hr);
+ WrapLogExit("CMenuSiteWrap::UIActivateDBC()", hr);
return hr;
}
@@ -271,8 +271,8 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::GetWindow(HWND *phwnd=%p)\n", this,
phwnd);
HRESULT hr = m_IOleWindow->GetWindow(phwnd);
- if (phwnd) WrapLogMsg("*phwnd=%p\n", *phwnd);
- WrapLogExit("CMenuSiteWrap::GetWindow() = %08x\n", hr);
+ if (phwnd) WrapLogPost("*phwnd=%p\n", *phwnd);
+ WrapLogExit("CMenuSiteWrap::GetWindow()", hr);
return hr;
}
@@ -280,7 +280,7 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::ContextSensitiveHelp(BOOL
fEnterMode=%d)\n", this, fEnterMode);
HRESULT hr = m_IOleWindow->ContextSensitiveHelp(fEnterMode);
- WrapLogExit("CMenuSiteWrap::ContextSensitiveHelp() = %08x\n", hr);
+ WrapLogExit("CMenuSiteWrap::ContextSensitiveHelp()", hr);
return hr;
}
@@ -289,17 +289,17 @@
{
WrapLogEnter("CMenuSiteWrap<%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("CMenuSiteWrap::QueryStatus() = %08x\n", hr);
+ if (pguidCmdGroup) WrapLogPost("*pguidCmdGroup=%s\n",
Wrap(*pguidCmdGroup));
+ WrapLogExit("CMenuSiteWrap::QueryStatus()", hr);
return hr;
}
HRESULT STDMETHODCALLTYPE CMenuSiteWrap::Exec(const GUID *pguidCmdGroup, DWORD nCmdID,
DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
{
WrapLogEnter("CMenuSiteWrap<%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));
+ if (pguidCmdGroup) WrapLogPre("*pguidCmdGroup=%s\n",
Wrap(*pguidCmdGroup));
HRESULT hr = m_IOleCommandTarget->Exec(pguidCmdGroup, nCmdID, nCmdexecopt, pvaIn,
pvaOut);
- WrapLogExit("CMenuSiteWrap::Exec() = %08x\n", hr);
+ WrapLogExit("CMenuSiteWrap::Exec()", hr);
return hr;
}
@@ -308,7 +308,7 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::UIActivateIO(BOOL fActivate=%d, LPMSG
lpMsg=%p)\n", this, fActivate, lpMsg);
HRESULT hr = m_IInputObject->UIActivateIO(fActivate, lpMsg);
- WrapLogExit("CMenuSiteWrap::UIActivateIO() = %08x\n", hr);
+ WrapLogExit("CMenuSiteWrap::UIActivateIO()", hr);
return hr;
}
@@ -316,16 +316,16 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::HasFocusIO()\n", this);
HRESULT hr = m_IInputObject->HasFocusIO();
- WrapLogExit("CMenuSiteWrap::HasFocusIO() = %08x\n", hr);
+ WrapLogExit("CMenuSiteWrap::HasFocusIO()", hr);
return hr;
}
HRESULT STDMETHODCALLTYPE CMenuSiteWrap::TranslateAcceleratorIO(LPMSG lpMsg)
{
WrapLogEnter("CMenuSiteWrap<%p>::TranslateAcceleratorIO(LPMSG
lpMsg=%p)\n", this, lpMsg);
- if (lpMsg) WrapLogMsg("*lpMsg=%s\n", Wrap(*lpMsg));
+ if (lpMsg) WrapLogPre("*lpMsg=%s\n", Wrap(*lpMsg));
HRESULT hr = m_IInputObject->TranslateAcceleratorIO(lpMsg);
- WrapLogExit("CMenuSiteWrap::TranslateAcceleratorIO() = %08x\n", hr);
+ WrapLogExit("CMenuSiteWrap::TranslateAcceleratorIO()", hr);
return hr;
}
@@ -334,7 +334,7 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::OnFocusChangeIS(LPUNKNOWN lpUnknown=%p,
BOOL bFocus=%d)\n", this, lpUnknown, bFocus);
HRESULT hr = m_IInputObjectSite->OnFocusChangeIS(lpUnknown, bFocus);
- WrapLogExit("CMenuSiteWrap::OnFocusChangeIS() = %08x\n", hr);
+ WrapLogExit("CMenuSiteWrap::OnFocusChangeIS()", hr);
return hr;
}
@@ -343,7 +343,7 @@
{
//WrapLogEnter("CMenuSiteWrap<%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("CMenuSiteWrap::OnWinEvent() = %08x\n", hr);
+ //WrapLogExit("CMenuSiteWrap::OnWinEvent()", hr);
return hr;
}
@@ -351,7 +351,7 @@
{
//WrapLogEnter("CMenuSiteWrap<%p>::IsWindowOwner(HWND hWnd=%08x)\n",
this, hWnd);
HRESULT hr = m_IWinEventHandler->IsWindowOwner(hWnd);
- //WrapLogExit("CMenuSiteWrap::IsWindowOwner() = %08x\n", hr);
+ //WrapLogExit("CMenuSiteWrap::IsWindowOwner()", hr);
return hr;
}
@@ -360,7 +360,7 @@
{
WrapLogEnter("CMenuSiteWrap<%p>::QueryService(REFGUID guidService=%s,
REFIID riid=%s, void **ppvObject=%p)\n", this, Wrap(guidService), Wrap(riid),
ppvObject);
HRESULT hr = m_IServiceProvider->QueryService(guidService, riid, ppvObject);
- if (ppvObject) WrapLogMsg("*ppvObject=%p\n", *ppvObject);
- WrapLogExit("CMenuSiteWrap::QueryService() = %08x\n", hr);
- return hr;
-}
+ if (ppvObject) WrapLogPost("*ppvObject=%p\n", *ppvObject);
+ WrapLogExit("CMenuSiteWrap::QueryService()", hr);
+ return hr;
+}
Modified: branches/shell-experiments/base/shell/rshell/wraplog.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/wraplog.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/wraplog.cpp [iso-8859-1] Thu Feb 20
12:12:42 2014
@@ -30,12 +30,37 @@
}
}
-void __cdecl WrapLogMsg(_Printf_format_string_ const char* msg, ...)
+void __cdecl WrapLogPrint(_Printf_format_string_ const char* msg, ...)
{
va_list args;
for (int i = 0; i < callLevel; i++)
fputs(" ", log);
- fputs("-- ", log);
+ va_start(args, msg);
+ vfprintf(log, msg, args);
+ va_end(args);
+ fflush(log);
+ nTemps = 0;
+}
+
+void __cdecl WrapLogPre(_Printf_format_string_ const char* msg, ...)
+{
+ va_list args;
+ for (int i = 0; i < callLevel; i++)
+ fputs(" ", log);
+ fputs("pre: ", log);
+ va_start(args, msg);
+ vfprintf(log, msg, args);
+ va_end(args);
+ fflush(log);
+ nTemps = 0;
+}
+
+void __cdecl WrapLogPost(_Printf_format_string_ const char* msg, ...)
+{
+ va_list args;
+ for (int i = 0; i < callLevel; i++)
+ fputs(" ", log);
+ fputs("post: ", log);
va_start(args, msg);
vfprintf(log, msg, args);
va_end(args);
@@ -48,7 +73,7 @@
va_list args;
for (int i = 0; i < callLevel; i++)
fputs(" ", log);
- fputs("ENTER >> ", log);
+ fputs("CALL ", log);
va_start(args, msg);
vfprintf(log, msg, args);
va_end(args);
@@ -57,18 +82,25 @@
nTemps = 0;
}
-void __cdecl WrapLogExit(_Printf_format_string_ const char* msg, ...)
+void __cdecl WrapLogExit(const char* msg, HRESULT code)
{
- va_list args;
+ //if (FAILED(code))
+ // WrapLogPrint("RETURN %s = %08x\n", msg, code);
+ //else if (code == S_OK)
+ // WrapLogPrint("RETURN %s = S_OK\n", msg);
+ //else if (code == S_FALSE)
+ // WrapLogPrint("RETURN %s = S_FALSE\n", msg);
+ //else
+ // WrapLogPrint("RETURN %s = %d\n", msg, code);
+ if (FAILED(code))
+ WrapLogPrint("RETURN %08x\n", code);
+ else if (code == S_OK)
+ WrapLogPrint("RETURN S_OK\n");
+ else if (code == S_FALSE)
+ WrapLogPrint("RETURN S_FALSE\n");
+ else
+ WrapLogPrint("RETURN %d\n", code);
callLevel--;
- for (int i = 0; i < callLevel; i++)
- fputs(" ", log);
- fputs("EXIT <<< ", log);
- va_start(args, msg);
- vfprintf(log, msg, args);
- va_end(args);
- fflush(log);
- nTemps = 0;
}
template <class T>
Modified: branches/shell-experiments/base/shell/rshell/wraplog.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/wraplog.h [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/wraplog.h [iso-8859-1] Thu Feb 20
12:12:42 2014
@@ -2,9 +2,10 @@
void WrapLogOpen();
void WrapLogClose();
-void __cdecl WrapLogMsg(_Printf_format_string_ const char* msg, ...);
+void __cdecl WrapLogPre(_Printf_format_string_ const char* msg, ...);
+void __cdecl WrapLogPost(_Printf_format_string_ const char* msg, ...);
void __cdecl WrapLogEnter(_Printf_format_string_ const char* msg, ...);
-void __cdecl WrapLogExit(_Printf_format_string_ const char* msg, ...);
+void __cdecl WrapLogExit(const char* msg, HRESULT code);
template <class T>
LPSTR Wrap(const T& value);