Author: dquintana
Date: Tue Mar 11 10:42:25 2014
New Revision: 62472
URL:
http://svn.reactos.org/svn/reactos?rev=62472&view=rev
Log:
[RSHELL]
* Fix reusing the same toolbar when SetMenu is called multiple times.
* Avoid some null dereferences.
[BROWSEUI]
* Temporarily (?) disable the logo band.
The browser window's "coolbar" and menubar now display and work properly in
both Windows and ReactOS.
CORE-7586
Modified:
branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
branches/shell-experiments/base/shell/rshell/CMenuToolbars.h
branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
branches/shell-experiments/dll/win32/browseui/internettoolbar.h
branches/shell-experiments/dll/win32/browseui/precomp.h
branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp
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] Tue Mar 11
10:42:25 2014
@@ -28,6 +28,10 @@
WINE_DEFAULT_DEBUG_CHANNEL(CMenuBand);
+#undef UNIMPLEMENTED
+
+#define UNIMPLEMENTED DbgPrint("%s is UNIMPLEMENTED!\n", __FUNCTION__)
+
extern "C"
HRESULT WINAPI CMenuBand_Constructor(REFIID riid, LPVOID *ppv)
{
@@ -121,9 +125,14 @@
HWND hwnd,
DWORD dwFlags)
{
+ DbgPrint("CMenuBand::SetMenu called, hmenu=%p; hwnd=%p, flags=%x\n", hmenu,
hwnd, dwFlags);
+
+ BOOL created = FALSE;
+
if (m_staticToolbar == NULL)
{
m_staticToolbar = new CMenuStaticToolbar(this);
+ created = true;
}
m_hmenu = hmenu;
m_menuOwner = hwnd;
@@ -140,11 +149,18 @@
if (FAILED_UNEXPECTEDLY(hr))
return hr;
- hr = m_staticToolbar->CreateToolbar(hwndParent, m_dwFlags);
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
-
- hr = m_staticToolbar->FillToolbar();
+ if (created)
+ {
+ hr = m_staticToolbar->CreateToolbar(hwndParent, m_dwFlags);
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+
+ hr = m_staticToolbar->FillToolbar();
+ }
+ else
+ {
+ hr = m_staticToolbar->FillToolbar(TRUE);
+ }
}
return hr;
@@ -206,7 +222,7 @@
}
hr = IUnknown_QueryService(m_site, SID_SMenuPopup, IID_PPV_ARG(IMenuPopup,
&m_subMenuParent));
- if (FAILED(hr) && hr != E_NOINTERFACE)
+ if (hr != E_NOINTERFACE && FAILED_UNEXPECTEDLY(hr))
return hr;
CComPtr<IOleWindow> pTopLevelWindow;
@@ -303,6 +319,8 @@
if (m_staticToolbar == NULL && m_SFToolbar == NULL)
return E_FAIL;
+ pdbi->ptMinSize.x = max(sizeStatic.cx, sizeShlFld.cx) + 20;
+ pdbi->ptMinSize.y = sizeStatic.cy + sizeShlFld.cy;
pdbi->ptMaxSize.x = max(sizeStatic.cx, sizeShlFld.cx) + 20;
pdbi->ptMaxSize.y = sizeStatic.cy + sizeShlFld.cy;
@@ -368,9 +386,12 @@
{
HRESULT hr;
- hr = m_subMenuParent->SetSubMenu(this, fActivate);
- if (FAILED_UNEXPECTEDLY(hr))
- return hr;
+ if (m_subMenuParent)
+ {
+ hr = m_subMenuParent->SetSubMenu(this, fActivate);
+ if (FAILED_UNEXPECTEDLY(hr))
+ return hr;
+ }
if (fActivate)
{
@@ -436,18 +457,26 @@
switch (dwSelectType)
{
case MPOS_CHILDTRACKING:
+ if (!m_subMenuParent)
+ break;
// TODO: Cancel timers?
return m_subMenuParent->OnSelect(dwSelectType);
case MPOS_SELECTLEFT:
if (m_subMenuChild)
m_subMenuChild->OnSelect(MPOS_CANCELLEVEL);
+ if (!m_subMenuParent)
+ break;
return m_subMenuParent->OnSelect(dwSelectType);
case MPOS_SELECTRIGHT:
+ if (!m_subMenuParent)
+ break;
return m_subMenuParent->OnSelect(dwSelectType);
case MPOS_EXECUTE:
case MPOS_FULLCANCEL:
if (m_subMenuChild)
m_subMenuChild->OnSelect(dwSelectType);
+ if (!m_subMenuParent)
+ break;
return m_subMenuParent->OnSelect(dwSelectType);
case MPOS_CANCELLEVEL:
if (m_subMenuChild)
@@ -620,24 +649,17 @@
HRESULT CMenuBand::_TrackSubMenuUsingTrackPopupMenu(HMENU popup, INT x, INT y, RECT&
rcExclude)
{
- HWND sendTo = m_menuOwner;
-
TPMPARAMS params = { sizeof(TPMPARAMS), rcExclude };
UINT flags = TPM_VERPOSANIMATION | TPM_VERTICAL | TPM_LEFTALIGN;
- if (sendTo)
- {
- ::TrackPopupMenuEx(popup, flags, x, y, sendTo, ¶ms);
+ if (m_menuOwner)
+ {
+ ::TrackPopupMenuEx(popup, flags, x, y, m_menuOwner, ¶ms);
}
else
{
- // FIXME: Windows uses the top-level window when calling TrackPopupMenuEx,
- // but this is probably not the means by which it obtains that HWND.
- // Meanwhile, this works.
- GetWindow(&sendTo);
- sendTo = GetAncestor(sendTo, GA_ROOT);
- ::TrackPopupMenuEx(popup, flags, x, y, sendTo, ¶ms);
+ ::TrackPopupMenuEx(popup, flags, x, y, m_topLevelWindow, ¶ms);
}
return S_OK;
@@ -720,6 +742,8 @@
{
if (m_subMenuChild)
m_subMenuChild->OnSelect(MPOS_CANCELLEVEL);
+ if (!m_subMenuParent)
+ return S_OK;
return m_subMenuParent->OnSelect(MPOS_CANCELLEVEL);
}
else if (changeType == MPOS_SELECTRIGHT)
@@ -732,10 +756,14 @@
return S_FALSE;
}
}
+ if (!m_subMenuParent)
+ return S_OK;
return m_subMenuParent->OnSelect(changeType);
}
else
{
+ if (!m_subMenuParent)
+ return S_OK;
return m_subMenuParent->OnSelect(changeType);
}
return S_OK;
@@ -754,7 +782,10 @@
m_subMenuChild = popup;
if (popup)
{
- IUnknown_SetSite(popup, m_subMenuParent);
+ if (m_subMenuParent)
+ IUnknown_SetSite(popup, m_subMenuParent);
+ else
+ IUnknown_SetSite(popup, m_site);
popup->Popup(pAt, pExclude, MPPF_RIGHT);
}
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp [iso-8859-1] Tue Mar 11
10:42:25 2014
@@ -42,20 +42,9 @@
HRESULT CMenuToolbarBase::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam,
LRESULT *theResult)
{
- RECT rc;
- HDC hdc;
- HBRUSH bgBrush;
- HBRUSH hotBrush;
NMHDR * hdr;
- NMTBCUSTOMDRAW * cdraw;
- NMTBHOTITEM * hot;
- NMMOUSE * rclick;
NMPGCALCSIZE* csize;
- TBBUTTONINFO btni;
- COLORREF clrText;
- COLORREF clrTextHighlight;
SIZE tbs;
- bool isHot, isPopup;
*theResult = 0;
switch (uMsg)
@@ -70,6 +59,9 @@
case TTN_GETDISPINFOA:
case TTN_GETDISPINFOW:
return S_OK;
+
+ case TBN_DELETINGBUTTON:
+ return OnDeletingButton(reinterpret_cast<LPNMTOOLBAR>(hdr));
case PGN_CALCSIZE:
csize = reinterpret_cast<LPNMPGCALCSIZE>(hdr);
@@ -90,83 +82,17 @@
return OnCommand(wParam, 0, theResult);
case TBN_HOTITEMCHANGE:
- hot = reinterpret_cast<LPNMTBHOTITEM>(hdr);
- return OnHotItemChange(hot);
+ return OnHotItemChange(reinterpret_cast<LPNMTBHOTITEM>(hdr));
case NM_RCLICK:
- rclick = reinterpret_cast<LPNMMOUSE>(hdr);
-
- return OnContextMenu(rclick);
+ return OnContextMenu(reinterpret_cast<LPNMMOUSE>(hdr));
case NM_CUSTOMDRAW:
- cdraw = reinterpret_cast<LPNMTBCUSTOMDRAW>(hdr);
- switch (cdraw->nmcd.dwDrawStage)
- {
- case CDDS_PREPAINT:
- if (m_toolbarFlags & SMINIT_VERTICAL)
- *theResult = CDRF_NOTIFYITEMDRAW;
- return S_OK;
-
- case CDDS_ITEMPREPAINT:
-
- clrText = GetSysColor(COLOR_MENUTEXT);
- clrTextHighlight = GetSysColor(COLOR_HIGHLIGHTTEXT);
-
- bgBrush = GetSysColorBrush(COLOR_MENU);
- hotBrush = GetSysColorBrush(m_useFlatMenus ? COLOR_MENUHILIGHT :
COLOR_HIGHLIGHT);
-
- rc = cdraw->nmcd.rc;
- hdc = cdraw->nmcd.hdc;
-
- isHot = m_hotBar == this && m_hotItem ==
static_cast<INT>(cdraw->nmcd.dwItemSpec);
- isPopup = m_popupBar == this && m_popupItem ==
static_cast<INT>(cdraw->nmcd.dwItemSpec);
-
- if (isHot || (m_hotItem < 0 && isPopup))
- {
- cdraw->nmcd.uItemState |= CDIS_HOT;
- }
- else
- {
- cdraw->nmcd.uItemState &= ~CDIS_HOT;
- }
-
- if (cdraw->nmcd.uItemState&CDIS_HOT)
- {
- FillRect(hdc, &rc, hotBrush);
- SetTextColor(hdc, clrTextHighlight);
- cdraw->clrText = clrTextHighlight;
- }
- else
- {
- FillRect(hdc, &rc, bgBrush);
- SetTextColor(hdc, clrText);
- cdraw->clrText = clrText;
- }
-
- cdraw->iListGap += 4;
-
- *theResult = CDRF_NOTIFYPOSTPAINT | TBCDRF_NOBACKGROUND | TBCDRF_NOEDGES
| TBCDRF_NOOFFSET | TBCDRF_NOMARK | 0x00800000; // FIXME: the last bit is Vista+, for
debugging only
- return S_OK;
-
- case CDDS_ITEMPOSTPAINT:
- btni.cbSize = sizeof(btni);
- btni.dwMask = TBIF_STYLE;
- SendMessage(hWnd, TB_GETBUTTONINFO, cdraw->nmcd.dwItemSpec,
reinterpret_cast<LPARAM>(&btni));
- if (btni.fsStyle & BTNS_DROPDOWN)
- {
- SelectObject(cdraw->nmcd.hdc, m_marlett);
- WCHAR text[] = L"8";
- SetBkMode(cdraw->nmcd.hdc, TRANSPARENT);
- RECT rc = cdraw->nmcd.rc;
- rc.right += 1;
- DrawTextEx(cdraw->nmcd.hdc, text, 1, &rc, DT_NOCLIP |
DT_VCENTER | DT_RIGHT | DT_SINGLELINE, NULL);
- }
- *theResult = TRUE;
- return S_OK;
- }
- return S_OK;
+ return OnCustomDraw(reinterpret_cast<LPNMTBCUSTOMDRAW>(hdr),
theResult);
+
case RBN_CHILDSIZE:
return S_OK;
+
default:
DbgPrint("WM_NOTIFY unknown code %d, %d\n", hdr->code,
hdr->idFrom);
}
@@ -174,6 +100,84 @@
}
return S_FALSE;
+}
+
+HRESULT CMenuToolbarBase::OnCustomDraw(LPNMTBCUSTOMDRAW cdraw, LRESULT * theResult)
+{
+ RECT rc;
+ HDC hdc;
+ HBRUSH bgBrush;
+ HBRUSH hotBrush;
+ COLORREF clrText;
+ COLORREF clrTextHighlight;
+ bool isHot, isPopup;
+ TBBUTTONINFO btni;
+
+ switch (cdraw->nmcd.dwDrawStage)
+ {
+ case CDDS_PREPAINT:
+ if (m_toolbarFlags & SMINIT_VERTICAL)
+ *theResult = CDRF_NOTIFYITEMDRAW;
+ return S_OK;
+
+ case CDDS_ITEMPREPAINT:
+
+ clrText = GetSysColor(COLOR_MENUTEXT);
+ clrTextHighlight = GetSysColor(COLOR_HIGHLIGHTTEXT);
+
+ bgBrush = GetSysColorBrush(COLOR_MENU);
+ hotBrush = GetSysColorBrush(m_useFlatMenus ? COLOR_MENUHILIGHT :
COLOR_HIGHLIGHT);
+
+ rc = cdraw->nmcd.rc;
+ hdc = cdraw->nmcd.hdc;
+
+ isHot = m_hotBar == this && m_hotItem ==
static_cast<INT>(cdraw->nmcd.dwItemSpec);
+ isPopup = m_popupBar == this && m_popupItem ==
static_cast<INT>(cdraw->nmcd.dwItemSpec);
+
+ if (isHot || (m_hotItem < 0 && isPopup))
+ {
+ cdraw->nmcd.uItemState |= CDIS_HOT;
+ }
+ else
+ {
+ cdraw->nmcd.uItemState &= ~CDIS_HOT;
+ }
+
+ if (cdraw->nmcd.uItemState&CDIS_HOT)
+ {
+ FillRect(hdc, &rc, hotBrush);
+ SetTextColor(hdc, clrTextHighlight);
+ cdraw->clrText = clrTextHighlight;
+ }
+ else
+ {
+ FillRect(hdc, &rc, bgBrush);
+ SetTextColor(hdc, clrText);
+ cdraw->clrText = clrText;
+ }
+
+ cdraw->iListGap += 4;
+
+ *theResult = CDRF_NOTIFYPOSTPAINT | TBCDRF_NOBACKGROUND | TBCDRF_NOEDGES |
TBCDRF_NOOFFSET | TBCDRF_NOMARK | 0x00800000; // FIXME: the last bit is Vista+, for
debugging only
+ return S_OK;
+
+ case CDDS_ITEMPOSTPAINT:
+ btni.cbSize = sizeof(btni);
+ btni.dwMask = TBIF_STYLE;
+ SendMessage(m_hwndToolbar, TB_GETBUTTONINFO, cdraw->nmcd.dwItemSpec,
reinterpret_cast<LPARAM>(&btni));
+ if (btni.fsStyle & BTNS_DROPDOWN)
+ {
+ SelectObject(cdraw->nmcd.hdc, m_marlett);
+ WCHAR text[] = L"8";
+ SetBkMode(cdraw->nmcd.hdc, TRANSPARENT);
+ RECT rc = cdraw->nmcd.rc;
+ rc.right += 1;
+ DrawTextEx(cdraw->nmcd.hdc, text, 1, &rc, DT_NOCLIP | DT_VCENTER |
DT_RIGHT | DT_SINGLELINE, NULL);
+ }
+ *theResult = TRUE;
+ return S_OK;
+ }
+ return S_OK;
}
CMenuToolbarBase::CMenuToolbarBase(CMenuBand *menuBand, BOOL usePager) :
@@ -845,10 +849,18 @@
return S_OK;
}
-HRESULT CMenuStaticToolbar::FillToolbar()
+HRESULT CMenuStaticToolbar::FillToolbar(BOOL clearFirst)
{
int i;
int ic = GetMenuItemCount(m_hmenu);
+
+ if (clearFirst)
+ {
+ while (SendMessage(m_hwndToolbar, TB_DELETEBUTTON, 0, 0))
+ {
+ // empty;
+ }
+ }
int count = 0;
for (i = 0; i < ic; i++)
@@ -896,6 +908,14 @@
}
}
+ DbgPrint("Created toolbar with %d buttons.\n", count);
+
+ return S_OK;
+}
+
+HRESULT CMenuStaticToolbar::OnDeletingButton(const NMTOOLBAR * tb)
+{
+ delete reinterpret_cast<SMINFO*>(tb->tbButton.dwData);
return S_OK;
}
@@ -959,7 +979,7 @@
{
}
-HRESULT CMenuSFToolbar::FillToolbar()
+HRESULT CMenuSFToolbar::FillToolbar(BOOL clearFirst)
{
HRESULT hr;
int i = 0;
@@ -1009,7 +1029,15 @@
return AddPlaceholder();
}
+ DbgPrint("Created toolbar with %d buttons.\n", i);
+
return hr;
+}
+
+HRESULT CMenuSFToolbar::OnDeletingButton(const NMTOOLBAR * tb)
+{
+ ILFree(reinterpret_cast<LPITEMIDLIST>(tb->tbButton.dwData));
+ return S_OK;
}
HRESULT CMenuSFToolbar::SetShellFolder(IShellFolder *psf, LPCITEMIDLIST pidlFolder, HKEY
hKey, DWORD dwFlags)
Modified: branches/shell-experiments/base/shell/rshell/CMenuToolbars.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuToolbars.h [iso-8859-1] Tue Mar 11
10:42:25 2014
@@ -74,7 +74,7 @@
void InvalidateDraw();
- virtual HRESULT FillToolbar() = 0;
+ virtual HRESULT FillToolbar(BOOL clearFirst=FALSE) = 0;
virtual HRESULT OnContextMenu(NMMOUSE * rclick) = 0;
HRESULT PopupItem(INT uItem);
@@ -84,6 +84,7 @@
protected:
virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult);
+ virtual HRESULT OnDeletingButton(const NMTOOLBAR * tb) = 0;
virtual HRESULT InternalPopupItem(INT uItem, INT index, DWORD_PTR dwData) = 0;
virtual HRESULT InternalHasSubMenu(INT uItem, INT index, DWORD_PTR dwData) = 0;
@@ -94,6 +95,9 @@
HRESULT AddPlaceholder();
HRESULT UpdateImageLists();
+
+private:
+ HRESULT OnCustomDraw(LPNMTBCUSTOMDRAW cdraw, LRESULT * theResult);
};
class CMenuStaticToolbar :
@@ -109,11 +113,13 @@
HRESULT SetMenu(HMENU hmenu, HWND hwnd, DWORD dwFlags);
HRESULT GetMenu(HMENU *phmenu, HWND *phwnd, DWORD *pdwFlags);
- virtual HRESULT FillToolbar();
+ virtual HRESULT FillToolbar(BOOL clearFirst=FALSE);
virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult);
virtual HRESULT OnContextMenu(NMMOUSE * rclick);
protected:
+ virtual HRESULT OnDeletingButton(const NMTOOLBAR * tb);
+
virtual HRESULT InternalPopupItem(INT uItem, INT index, DWORD_PTR dwData);
virtual HRESULT InternalHasSubMenu(INT uItem, INT index, DWORD_PTR dwData);
};
@@ -133,11 +139,13 @@
HRESULT SetShellFolder(IShellFolder *psf, LPCITEMIDLIST pidlFolder, HKEY hKey, DWORD
dwFlags);
HRESULT GetShellFolder(DWORD *pdwFlags, LPITEMIDLIST *ppidl, REFIID riid, void
**ppv);
- virtual HRESULT FillToolbar();
+ virtual HRESULT FillToolbar(BOOL clearFirst=FALSE);
virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult);
virtual HRESULT OnContextMenu(NMMOUSE * rclick);
protected:
+ virtual HRESULT OnDeletingButton(const NMTOOLBAR * tb);
+
virtual HRESULT InternalPopupItem(INT uItem, INT index, DWORD_PTR dwData);
virtual HRESULT InternalHasSubMenu(INT uItem, INT index, DWORD_PTR dwData);
};
Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/browseui/internettoolbar.cpp [iso-8859-1] Tue Mar
11 10:42:25 2014
@@ -822,7 +822,7 @@
HRESULT STDMETHODCALLTYPE CInternetToolbar::InitNew()
{
CComPtr<IShellMenu> menuBar;
- CComPtr<IUnknown> logoBar;
+ //CComPtr<IUnknown> logoBar;
CComPtr<IUnknown> toolsBar;
CComPtr<IUnknown> navigationBar;
CComPtr<IOleWindow> menuOleWindow;
@@ -840,12 +840,14 @@
hResult = menuOleWindow->GetWindow(&fMenuBandWindow);
fMenuBar.Attach(menuBar.Detach()); // transfer the ref count
+ /* FIXME
hResult = CreateBrandBand(&logoBar);
if (FAILED(hResult))
return hResult;
AddDockItem(logoBar, ITBBID_BRANDBAND,
CDockSite::ITF_NOGRIPPER | CDockSite::ITF_NOTITLE | CDockSite::ITF_FIXEDSIZE);
fLogoBar.Attach(logoBar.Detach()); // transfer the ref count
+ */
hResult = CreateToolsBar(&toolsBar);
if (FAILED(hResult))
@@ -1217,8 +1219,8 @@
return E_POINTER;
if (dwBandID == ITBBID_MENUBAND && fMenuBar.p != NULL)
return fMenuBar->QueryInterface(IID_IDeskBand, reinterpret_cast<void
**>(ppstb));
- if (dwBandID == ITBBID_BRANDBAND && fLogoBar.p != NULL)
- return fLogoBar->QueryInterface(IID_IDeskBand, reinterpret_cast<void
**>(ppstb));
+ //if (dwBandID == ITBBID_BRANDBAND && fLogoBar.p != NULL)
+ // return fLogoBar->QueryInterface(IID_IDeskBand, reinterpret_cast<void
**>(ppstb));
*ppstb = NULL;
return E_FAIL;
}
Modified: branches/shell-experiments/dll/win32/browseui/internettoolbar.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/internettoolbar.h [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/browseui/internettoolbar.h [iso-8859-1] Tue Mar
11 10:42:25 2014
@@ -87,7 +87,7 @@
CComPtr<IShellMenu> fMenuBar; // the menu rebar
HWND fMenuBandWindow;
HWND fNavigationWindow;
- CComPtr<IUnknown> fLogoBar; // the reactos
logo
+ //CComPtr<IUnknown> fLogoBar; // the reactos
logo
CComPtr<IUnknown> fControlsBar; // navigation
controls
CComPtr<IUnknown> fNavigationBar; // address bar
CComObject<CMenuCallback> fMenuCallback;
Modified: branches/shell-experiments/dll/win32/browseui/precomp.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/precomp.h [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/precomp.h [iso-8859-1] Tue Mar 11
10:42:25 2014
@@ -76,6 +76,12 @@
#define DbgPrint(fmt, ...) \
Win32DbgPrint(__FILE__, __LINE__, fmt, ##__VA_ARGS__)
+#if 1
+#define FAILED_UNEXPECTEDLY(hr) (FAILED(hr) && (DbgPrint("Unexpected failure
%08x.\n", hr), TRUE))
+#else
+#define FAILED_UNEXPECTEDLY(hr) FAILED(hr)
+#endif
+
WINE_DEFAULT_DEBUG_CHANNEL(browseui);
#endif /* _BROWSEUI_PCH_ */
Modified: branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp [iso-8859-1] Tue Mar 11
10:42:25 2014
@@ -814,29 +814,6 @@
ShowWindow(SW_SHOWNORMAL);
-
- // test code to make brand band animate
- {
- CComPtr<IOleCommandTarget> oleCommandTarget;
- CComPtr<IServiceProvider> serviceProvider;
- CComPtr<IBandSite> bandSite;
- CComPtr<IDeskBand> deskBand;
- CComPtr<IWinEventHandler> winEventHandler;
- HRESULT hResult;
-
- if (fClientBars[BIInternetToolbar].clientBar.p == NULL)
- return 0;
- hResult = fClientBars[BIInternetToolbar].clientBar->
- QueryInterface(IID_IServiceProvider, reinterpret_cast<void
**>(&serviceProvider));
- hResult = serviceProvider->QueryService(SID_IBandSite, IID_IBandSite,
reinterpret_cast<void **>(&bandSite));
- hResult = bandSite->QueryBand(5, &deskBand, NULL, NULL, 0);
- deskBand->QueryInterface(IID_IWinEventHandler, reinterpret_cast<void
**>(&winEventHandler));
- winEventHandler->IsWindowOwner(NULL);
- deskBand->QueryInterface(IID_IOleCommandTarget, reinterpret_cast<void
**>(&oleCommandTarget));
- oleCommandTarget->QueryStatus(&CGID_BrandCmdGroup, 0, NULL, NULL);
- oleCommandTarget->Exec(&CGID_BrandCmdGroup, BBID_STARTANIMATION, 0, NULL,
NULL);
- }
-
return S_OK;
}
@@ -3256,6 +3233,9 @@
TranslateMessage(&Msg);
DispatchMessage(&Msg);
+
+ if (Msg.message == WM_QUIT)
+ break;
}
}
}