Author: dquintana
Date: Wed Feb 26 11:13:23 2014
New Revision: 62334
URL:
http://svn.reactos.org/svn/reactos?rev=62334&view=rev
Log:
[EXPLORER-NEW]
* Show the start menu at the same position and alignment Windows uses.
[RSHELL]
* Use IShellFolder methods instead of SHCreateShellItem.
* Handle toolbar window events from the toolbar class.
* Improve the positioning calculations.
* TODO: How to tell the submenus of the start menu to show towards the left? For when the
taskbar is ABE_RIGHT.
CORE-7596
Modified:
branches/shell-experiments/base/shell/explorer-new/traywnd.c
branches/shell-experiments/base/shell/rshell/CMenuBand.cpp
branches/shell-experiments/base/shell/rshell/CMenuBand.h
branches/shell-experiments/base/shell/rshell/CMenuDeskBar.cpp
branches/shell-experiments/base/shell/rshell/CMenuDeskBar.h
branches/shell-experiments/base/shell/rshell/CMenuToolbars.cpp
branches/shell-experiments/base/shell/rshell/CMenuToolbars.h
branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp
branches/shell-experiments/base/shell/rshell/precomp.h
branches/shell-experiments/base/shell/rshell/wraplog.cpp
Modified: branches/shell-experiments/base/shell/explorer-new/traywnd.c
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/ex…
==============================================================================
--- branches/shell-experiments/base/shell/explorer-new/traywnd.c [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/explorer-new/traywnd.c [iso-8859-1] Wed Feb 26
11:13:23 2014
@@ -2083,21 +2083,24 @@
if (GetWindowRect(This->hwndStart,
(RECT*) &rcExclude))
{
- if (ITrayWindowImpl_IsPosHorizontal(This))
- {
+ switch (This->Position)
+ {
+ case ABE_BOTTOM:
pt.x = rcExclude.left;
pt.y = rcExclude.top;
dwFlags |= MPPF_BOTTOM;
- }
- else
- {
- if (This->Position == ABE_LEFT)
- pt.x = rcExclude.left;
- else
- pt.x = rcExclude.right;
-
+ break;
+ case ABE_TOP:
+ case ABE_LEFT:
+ pt.x = rcExclude.left;
pt.y = rcExclude.bottom;
- dwFlags |= MPPF_BOTTOM;
+ dwFlags |= MPPF_TOP | MPPF_ALIGN_RIGHT;
+ break;
+ case ABE_RIGHT:
+ pt.x = rcExclude.right;
+ pt.y = rcExclude.bottom;
+ dwFlags |= MPPF_TOP | MPPF_ALIGN_LEFT;
+ break;
}
IMenuPopup_Popup(This->StartMenuPopup,
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 26
11:13:23 2014
@@ -58,11 +58,6 @@
m_popupItem(-1)
{
m_focusManager = CMenuFocusManager::AcquireManager();
-
- m_marlett = CreateFont(
- 0, 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET,
- OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
- DEFAULT_QUALITY, FF_DONTCARE, L"Marlett");
}
CMenuBand::~CMenuBand()
@@ -74,8 +69,6 @@
if (m_SFToolbar)
delete m_SFToolbar;
-
- DeleteObject(m_marlett);
}
HRESULT STDMETHODCALLTYPE CMenuBand::Initialize(
@@ -553,186 +546,18 @@
HRESULT STDMETHODCALLTYPE CMenuBand::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;
- BOOL useFlatMenus = FALSE;
- COLORREF clrText;
- COLORREF clrTextHighlight;
-
-
*theResult = 0;
- switch (uMsg)
- {
- case WM_COMMAND:
-
- if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd) == S_OK)
- {
- return m_staticToolbar->OnCommand(wParam, lParam, theResult);
- }
-
- if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd) == S_OK)
- {
- return m_SFToolbar->OnCommand(wParam, lParam, theResult);
- }
-
- return S_OK;
-
- case WM_NOTIFY:
- hdr = reinterpret_cast<LPNMHDR>(lParam);
- switch (hdr->code)
- {
- case PGN_CALCSIZE:
- csize = reinterpret_cast<LPNMPGCALCSIZE>(hdr);
-
- if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd) ==
S_OK)
- {
- SIZE tbs;
- m_staticToolbar->GetIdealSize(tbs);
- if (csize->dwFlag == PGF_CALCHEIGHT)
- {
- csize->iHeight = tbs.cy;
- }
- else if (csize->dwFlag == PGF_CALCWIDTH)
- {
- csize->iHeight = tbs.cx;
- }
- }
-
- if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd) == S_OK)
- {
- SIZE tbs;
- m_SFToolbar->GetIdealSize(tbs);
- if (csize->dwFlag == PGF_CALCHEIGHT)
- {
- csize->iHeight = tbs.cy;
- }
- else if (csize->dwFlag == PGF_CALCWIDTH)
- {
- csize->iHeight = tbs.cx;
- }
- }
- return S_OK;
-
- case TBN_DROPDOWN:
-
- if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd) ==
S_OK)
- {
- WPARAM wp = reinterpret_cast<LPNMTOOLBAR>(hdr)->iItem;
- return m_staticToolbar->OnCommand(wp, 0, theResult);
- }
-
- if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd) == S_OK)
- {
- WPARAM wp = reinterpret_cast<LPNMTOOLBAR>(hdr)->iItem;
- return m_SFToolbar->OnCommand(wp, 0, theResult);
- }
-
- return S_OK;
-
- case TBN_HOTITEMCHANGE:
- hot = reinterpret_cast<LPNMTBHOTITEM>(hdr);
-
- if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd) ==
S_OK)
- {
- return m_staticToolbar->OnHotItemChange(hot);
- }
-
- if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd) == S_OK)
- {
- return m_SFToolbar->OnHotItemChange(hot);
- }
-
- return S_OK;
-
- case NM_RCLICK:
- rclick = reinterpret_cast<LPNMMOUSE>(hdr);
-
- if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd) ==
S_OK)
- {
- return m_staticToolbar->OnContextMenu(rclick);
- }
-
- if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd) == S_OK)
- {
- return m_SFToolbar->OnContextMenu(rclick);
- }
-
- return S_OK;
-
- case NM_CUSTOMDRAW:
- cdraw = reinterpret_cast<LPNMTBCUSTOMDRAW>(hdr);
- switch (cdraw->nmcd.dwDrawStage)
- {
- case CDDS_PREPAINT:
- *theResult = CDRF_NOTIFYITEMDRAW;
- return S_OK;
-
- case CDDS_ITEMPREPAINT:
-
- SystemParametersInfo(SPI_GETFLATMENU, 0, &useFlatMenus, 0);
-
- clrText = GetSysColor(COLOR_MENUTEXT);
- clrTextHighlight = GetSysColor(COLOR_HIGHLIGHTTEXT);
-
- bgBrush = GetSysColorBrush(COLOR_MENU);
- hotBrush = GetSysColorBrush(useFlatMenus ? COLOR_MENUHILIGHT :
COLOR_HIGHLIGHT);
-
- rc = cdraw->nmcd.rc;
- hdc = cdraw->nmcd.hdc;
-
- if (((INT)cdraw->nmcd.dwItemSpec == m_hotItem ||
- (m_hotItem < 0 && (INT)cdraw->nmcd.dwItemSpec ==
m_popupItem)))
- {
- cdraw->nmcd.uItemState = CDIS_HOT;
- }
-
- switch (cdraw->nmcd.uItemState)
- {
- case CDIS_HOT:
- case CDIS_FOCUS:
- FillRect(hdc, &rc, hotBrush);
- SetTextColor(hdc, clrTextHighlight);
- cdraw->clrText = clrTextHighlight;
- break;
- default:
- FillRect(hdc, &rc, bgBrush);
- SetTextColor(hdc, clrText);
- cdraw->clrText = clrText;
- break;
- }
-
- 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);
- DrawTextEx(cdraw->nmcd.hdc, text, 1, &cdraw->nmcd.rc,
DT_NOCLIP | DT_VCENTER | DT_RIGHT | DT_SINGLELINE, NULL);
- }
- *theResult = TRUE;
- return S_OK;
- }
- return S_OK;
- }
- return S_OK;
- }
-
+
+ if (m_staticToolbar && m_staticToolbar->IsWindowOwner(hWnd) == S_OK)
+ {
+ return m_staticToolbar->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
+ }
+
+ if (m_SFToolbar && m_SFToolbar->IsWindowOwner(hWnd) == S_OK)
+ {
+ return m_SFToolbar->OnWinEvent(hWnd, uMsg, wParam, lParam, theResult);
+ }
+
return S_FALSE;
}
Modified: branches/shell-experiments/base/shell/rshell/CMenuBand.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuBand.h [iso-8859-1] Wed Feb 26
11:13:23 2014
@@ -61,8 +61,6 @@
CMenuToolbarBase * m_hotBar;
INT m_hotItem;
INT m_popupItem;
-
- HFONT m_marlett;
public:
CMenuBand();
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 26
11:13:23 2014
@@ -280,6 +280,7 @@
return hr;
::AdjustWindowRect(&rc, ::GetWindowLong(m_hWnd, GWL_STYLE), FALSE);
+ ::OffsetRect(&rc, -rc.left, -rc.top);
if (m_Banner != NULL)
{
@@ -287,35 +288,46 @@
::GetObject(m_Banner, sizeof(bm), &bm);
rc.right += bm.bmWidth;
}
-
+
int x, y, cx, cy;
RECT rcWorkArea;
- SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, 0);
+ GetWindowRect(GetDesktopWindow(), &rcWorkArea);
int waHeight = rcWorkArea.bottom - rcWorkArea.top;
- switch (dwFlags & MPPF_POS_MASK)
- {
- case MPPF_LEFT:
- case MPPF_TOP:
+ switch (dwFlags & 0xFF000000)
+ {
+ case MPPF_BOTTOM:
+ x = ppt->x;
+ cx = rc.right - rc.left;
+ y = ppt->y - rc.bottom;
+ cy = rc.bottom - rc.top;
+ break;
+ case MPPF_RIGHT:
+ x = ppt->x + rc.left;
+ cx = rc.right - rc.left;
+ y = ppt->y + rc.top;
+ cy = rc.bottom - rc.top;
+ break;
+ case MPPF_TOP | MPPF_ALIGN_LEFT:
x = ppt->x - rc.right;
cx = rc.right - rc.left;
+ y = ppt->y + rc.top;
+ cy = rc.bottom - rc.top;
break;
- default:
+ case MPPF_TOP | MPPF_ALIGN_RIGHT:
x = ppt->x;
cx = rc.right - rc.left;
- break;
- }
-
- if (dwFlags & MPPF_BOTTOM)
- {
- y = ppt->y - rc.bottom;
- cy = rc.bottom - rc.top;
- }
- else
- {
y = ppt->y + rc.top;
cy = rc.bottom - rc.top;
+ break;
+ }
+
+ if (x + cx > rcWorkArea.right)
+ {
+ // FIXME: Works, but it's oversimplified.
+ x = prcExclude->left - cx;
+ dwFlags = (dwFlags & (~MPPF_TOP)) | MPPF_LEFT;
}
if (y < rcWorkArea.top)
@@ -333,8 +345,11 @@
y = rcWorkArea.bottom - cy;
}
+
+
this->SetWindowPos(HWND_TOPMOST, x, y, cx, cy, SWP_SHOWWINDOW);
+ m_ShowFlags = dwFlags;
m_Shown = true;
// HACK: The bar needs to be notified of the size AFTER it is shown.
@@ -343,7 +358,6 @@
_OnSize(WM_SIZE, 0, 0, bHandled);
UIActivateIO(TRUE, NULL);
-
return S_OK;
}
Modified: branches/shell-experiments/base/shell/rshell/CMenuDeskBar.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMenuDeskBar.h [iso-8859-1] (original)
+++ branches/shell-experiments/base/shell/rshell/CMenuDeskBar.h [iso-8859-1] Wed Feb 26
11:13:23 2014
@@ -47,7 +47,8 @@
DWORD m_IconSize;
HBITMAP m_Banner;
- BOOL m_Shown;
+ BOOL m_Shown;
+ DWORD m_ShowFlags;
public:
CMenuDeskBar();
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] Wed Feb 26
11:13:23 2014
@@ -40,13 +40,149 @@
#define TIMERID_HOTTRACK 1
#define SUBCLASS_ID_MENUBAND 1
+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;
+
+ *theResult = 0;
+ switch (uMsg)
+ {
+ case WM_COMMAND:
+ return OnCommand(wParam, lParam, theResult);
+
+ case WM_NOTIFY:
+ hdr = reinterpret_cast<LPNMHDR>(lParam);
+ switch (hdr->code)
+ {
+ case PGN_CALCSIZE:
+ csize = reinterpret_cast<LPNMPGCALCSIZE>(hdr);
+
+ GetIdealSize(tbs);
+ if (csize->dwFlag == PGF_CALCHEIGHT)
+ {
+ csize->iHeight = tbs.cy;
+ }
+ else if (csize->dwFlag == PGF_CALCWIDTH)
+ {
+ csize->iHeight = tbs.cx;
+ }
+ return S_OK;
+
+ case TBN_DROPDOWN:
+ wParam = reinterpret_cast<LPNMTOOLBAR>(hdr)->iItem;
+ return OnCommand(wParam, 0, theResult);
+
+ case TBN_HOTITEMCHANGE:
+ hot = reinterpret_cast<LPNMTBHOTITEM>(hdr);
+ return OnHotItemChange(hot);
+
+ case NM_RCLICK:
+ rclick = reinterpret_cast<LPNMMOUSE>(hdr);
+
+ return OnContextMenu(rclick);
+
+ case NM_CUSTOMDRAW:
+ cdraw = reinterpret_cast<LPNMTBCUSTOMDRAW>(hdr);
+ switch (cdraw->nmcd.dwDrawStage)
+ {
+ case CDDS_PREPAINT:
+ *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;
+
+ if (((INT) cdraw->nmcd.dwItemSpec == m_hotItem ||
+ (m_hotItem < 0 && (INT) cdraw->nmcd.dwItemSpec ==
m_popupItem)))
+ {
+ cdraw->nmcd.uItemState = CDIS_HOT;
+ }
+
+ switch (cdraw->nmcd.uItemState)
+ {
+ case CDIS_HOT:
+ case CDIS_FOCUS:
+ FillRect(hdc, &rc, hotBrush);
+ SetTextColor(hdc, clrTextHighlight);
+ cdraw->clrText = clrTextHighlight;
+ break;
+ default:
+ FillRect(hdc, &rc, bgBrush);
+ SetTextColor(hdc, clrText);
+ cdraw->clrText = clrText;
+ break;
+ }
+
+ 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 S_OK;
+ }
+
+ return S_FALSE;
+}
+
CMenuToolbarBase::CMenuToolbarBase(CMenuBand *menuBand, BOOL usePager) :
m_hwnd(NULL),
+ m_useFlatMenus(FALSE),
m_menuBand(menuBand),
m_hwndToolbar(NULL),
m_dwMenuFlags(0),
- m_hasIdealSize(FALSE)
-{
+ m_hotItem(-1),
+ m_popupItem(-1),
+ m_SubclassOld(NULL),
+ m_hasIdealSize(FALSE),
+ m_usePager(usePager)
+{
+ m_marlett = CreateFont(
+ 0, 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET,
+ OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,
+ DEFAULT_QUALITY, FF_DONTCARE, L"Marlett");
+}
+
+CMenuToolbarBase::~CMenuToolbarBase()
+{
+ DeleteObject(m_marlett);
}
HRESULT CMenuToolbarBase::IsWindowOwner(HWND hwnd)
@@ -65,6 +201,8 @@
::ShowWindow(m_hwnd, fShow ? SW_SHOW : SW_HIDE);
UpdateImageLists();
+
+ SystemParametersInfo(SPI_GETFLATMENU, 0, &m_useFlatMenus, 0);
return S_OK;
}
@@ -283,9 +421,8 @@
ClientToScreen(m_hwndToolbar, &a);
ClientToScreen(m_hwndToolbar, &b);
- POINTL pt = { b.x - 4, a.y };
+ POINTL pt = { b.x - 3, a.y - 3 };
RECTL rcl = { a.x, a.y, b.x, b.y }; // maybe-TODO: fetch client area of deskbar?
-
#if USE_SYSTEM_MENUSITE
hr = CoCreateInstance(CLSID_MenuBandSite,
@@ -332,6 +469,7 @@
if (FAILED(hr))
return hr;
+ m_popupItem = itemId;
m_menuBand->_OnPopupSubMenu(itemId, popup, &pt, &rcl);
return S_OK;
@@ -680,21 +818,22 @@
tbb.fsState = TBSTATE_ENABLED;
tbb.fsStyle = 0;
- CComPtr<IShellItem> psi;
- hr = SHCreateShellItem(NULL, m_shellFolder, item, &psi);
+ STRRET sr = { STRRET_CSTR, { 0 } };
+
+ hr = m_shellFolder->GetDisplayNameOf(item, SIGDN_NORMALDISPLAY, &sr);
if (FAILED(hr))
return hr;
- hr = psi->GetDisplayName(SIGDN_NORMALDISPLAY, &MenuString);
- if (FAILED(hr))
- return hr;
+ StrRetToStr(&sr, NULL, &MenuString);
index = SHMapPIDLToSystemImageListIndex(m_shellFolder, item, &indexOpen);
- SFGAOF attrs;
- hr = psi->GetAttributes(SFGAO_FOLDER, &attrs);
-
- if (attrs != 0)
+ LPCITEMIDLIST itemc = item;
+
+ SFGAOF attrs = SFGAO_FOLDER;
+ hr = m_shellFolder->GetAttributesOf(1, &itemc, &attrs);
+
+ if (attrs & SFGAO_FOLDER)
{
tbb.fsStyle |= BTNS_DROPDOWN;
}
@@ -706,7 +845,7 @@
// FIXME: remove before deleting the toolbar or it will leak
SendMessageW(m_hwndToolbar, TB_ADDBUTTONS, 1,
reinterpret_cast<LPARAM>(&tbb));
- HeapFree(GetProcessHeap(), 0, MenuString);
+ CoTaskMemFree(MenuString);
}
CoTaskMemFree(item);
@@ -869,15 +1008,12 @@
HRESULT CMenuSFToolbar::HasSubMenu(UINT uItem)
{
HRESULT hr;
- CComPtr<IShellItem> psi;
- hr = SHCreateShellItem(NULL, m_shellFolder, GetPidlFromId(uItem), &psi);
- if (FAILED(hr))
- return S_FALSE;
-
- SFGAOF attrs;
- hr = psi->GetAttributes(SFGAO_FOLDER, &attrs);
- if (FAILED(hr))
- return hr;
-
- return (attrs != 0) ? S_OK : S_FALSE;
-}
+ LPCITEMIDLIST pidl = GetPidlFromId(uItem);
+
+ SFGAOF attrs = SFGAO_FOLDER;
+ hr = m_shellFolder->GetAttributesOf(1, &pidl, &attrs);
+ if (FAILED(hr))
+ return hr;
+
+ return (attrs & SFGAO_FOLDER) ? S_OK : S_FALSE;
+}
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] Wed Feb 26
11:13:23 2014
@@ -25,13 +25,16 @@
class CMenuToolbarBase
{
private:
- HWND m_hwnd; // May be the pager
+ HWND m_hwnd; // May be the pager
+ HFONT m_marlett;
+ BOOL m_useFlatMenus;
protected:
CMenuBand * m_menuBand;
HWND m_hwndToolbar;
DWORD m_dwMenuFlags;
INT m_hotItem;
+ INT m_popupItem;
WNDPROC m_SubclassOld;
BOOL m_hasIdealSize;
SIZE m_idealSize;
@@ -42,7 +45,7 @@
public:
CMenuToolbarBase(CMenuBand *menuBand, BOOL usePager);
- virtual ~CMenuToolbarBase() {}
+ virtual ~CMenuToolbarBase();
HRESULT IsWindowOwner(HWND hwnd);
HRESULT CreateToolbar(HWND hwndParent, DWORD dwFlags);
@@ -50,11 +53,12 @@
HRESULT ShowWindow(BOOL fShow);
HRESULT Close();
+ HRESULT OnWinEvent(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam, LRESULT
*theResult);
+
virtual HRESULT FillToolbar() = 0;
virtual HRESULT PopupItem(UINT uItem) = 0;
virtual HRESULT HasSubMenu(UINT uItem) = 0;
virtual HRESULT OnContextMenu(NMMOUSE * rclick) = 0;
- virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult);
HRESULT PopupSubMenu(UINT itemId, UINT index, IShellMenu* childShellMenu);
HRESULT PopupSubMenu(UINT index, HMENU menu);
@@ -69,6 +73,8 @@
void InvalidateDraw();
protected:
+ virtual HRESULT OnCommand(WPARAM wParam, LPARAM lParam, LRESULT *theResult);
+
LRESULT CALLBACK SubclassProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
HRESULT UpdateImageLists();
Modified: branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/base/shell/rs…
==============================================================================
--- branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp [iso-8859-1]
(original)
+++ branches/shell-experiments/base/shell/rshell/CMergedFolder.cpp [iso-8859-1] Wed Feb 26
11:13:23 2014
@@ -77,7 +77,7 @@
return hr;
if (hr == S_FALSE)
m_FirstDone = true;
- if (celt < 2)
+ else if (celt < 2)
return hr;
}
@@ -85,16 +85,19 @@
if (*pceltFetched < celt)
{
rgelt += *pceltFetched;
- celt = (*pceltFetched - celt);
+ celt = (celt - *pceltFetched);
*pceltFetched = 0;
+
+ hr = m_AllUSers->Next(celt, rgelt, pceltFetched);
+ if (FAILED(hr))
+ return hr;
+
+ *pceltFetched += offset;
+
+ return hr;
}
- hr = m_UserLocal->Next(celt, rgelt, pceltFetched);
- if (FAILED(hr))
- return hr;
-
- *pceltFetched += offset;
- return hr;
+ return S_OK;
}
virtual HRESULT STDMETHODCALLTYPE Skip(
@@ -227,6 +230,7 @@
if (SUCCEEDED(hr))
return hr;
+ *rgfInOut = 0;
hr = m_AllUSers->GetAttributesOf(cidl, apidl, rgfInOut);
return hr;
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 26
11:13:23 2014
@@ -6,6 +6,8 @@
#define WRAP_MENUDESKBAR 0
#define WRAP_MENUSITE 0
#define WRAP_MENUBAND 0
+
+#define MERGE_FOLDERS 0
#include <stdio.h>
#include <tchar.h>
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] Wed Feb 26
11:13:23 2014
@@ -13,7 +13,7 @@
{
if (openCount == 0)
{
- log = fopen("RShellWrap.log", "w");
+ log = fopen("\\RShellWrap.log", "w");
nTemps = 0;
callLevel = 0;
}