Author: dquintana
Date: Tue Aug 19 21:30:04 2014
New Revision: 63905
URL:
http://svn.reactos.org/svn/reactos?rev=63905&view=rev
Log:
[BROWSEUI]
[SHELL32]
* Fix accelerator handling.
* Disallow accelerators if renaming.
Modified:
branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp
branches/shell-experiments/dll/win32/shell32/shlview.cpp
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 Aug 19
21:30:04 2014
@@ -2563,13 +2563,7 @@
return S_OK;
}
- if (fCurrentShellView->TranslateAcceleratorW(pmsg) != S_OK)
- {
- if (TranslateAcceleratorSB(pmsg, 0) != S_OK)
- return S_FALSE;
- return S_OK;
- }
- return S_OK;
+ return fCurrentShellView->TranslateAcceleratorW(pmsg);
}
HRESULT STDMETHODCALLTYPE CShellBrowser::_GetBorderDWHelper(IUnknown *punkSrc, LPRECT
lprectBorder, BOOL bUseHmonitor)
Modified: branches/shell-experiments/dll/win32/shell32/shlview.cpp
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/she…
==============================================================================
--- branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/shell32/shlview.cpp [iso-8859-1] Tue Aug 19
21:30:04 2014
@@ -105,6 +105,8 @@
POINT m_ptLastMousePos; /* Mouse position at last
DragOver call */
//
CComPtr<IContextMenu> m_pCM;
+
+ BOOL m_isEditing;
public:
CDefView();
~CDefView();
@@ -173,7 +175,6 @@
virtual HRESULT STDMETHODCALLTYPE GetArrangeParam(LPARAM *sort);
virtual HRESULT STDMETHODCALLTYPE ArrangeGrid();
virtual HRESULT STDMETHODCALLTYPE AutoArrange();
- virtual HRESULT STDMETHODCALLTYPE IShellFolderView_GetAutoArrange();
virtual HRESULT STDMETHODCALLTYPE AddObject(PITEMID_CHILD pidl, UINT *item);
virtual HRESULT STDMETHODCALLTYPE GetObject(PITEMID_CHILD *pidl, UINT item);
virtual HRESULT STDMETHODCALLTYPE RemoveObject(PITEMID_CHILD pidl, UINT *item);
@@ -376,6 +377,7 @@
m_cScrollDelay = 0;
m_ptLastMousePos.x = 0;
m_ptLastMousePos.y = 0;
+ m_isEditing = FALSE;
}
CDefView::~CDefView()
@@ -1795,6 +1797,7 @@
m_pSFParent->GetAttributesOf(1, (LPCITEMIDLIST*)&pidl, &dwAttr);
if (SFGAO_CANRENAME & dwAttr)
{
+ m_isEditing = TRUE;
return FALSE;
}
return TRUE;
@@ -1803,6 +1806,9 @@
case LVN_ENDLABELEDITW:
{
TRACE("-- LVN_ENDLABELEDITW %p\n", this);
+
+ m_isEditing = FALSE;
+
if (lpdi->item.pszText)
{
HRESULT hr;
@@ -1991,6 +1997,9 @@
*/
HRESULT WINAPI CDefView::TranslateAccelerator(LPMSG lpmsg)
{
+ if (m_isEditing)
+ return S_FALSE;
+
if (lpmsg->message >= WM_KEYFIRST && lpmsg->message <=
WM_KEYLAST)
{
if (::TranslateAcceleratorW(m_hWnd, m_hAccel, lpmsg) != 0)
@@ -1999,7 +2008,7 @@
TRACE("-- key=0x04%lx\n", lpmsg->wParam) ;
}
- return S_FALSE; /* not handled */
+ return m_pShellBrowser->TranslateAcceleratorSB(lpmsg, 0);
}
HRESULT WINAPI CDefView::EnableModeless(BOOL fEnable)
@@ -2454,12 +2463,6 @@
return E_NOTIMPL;
}
-HRESULT STDMETHODCALLTYPE CDefView::IShellFolderView_GetAutoArrange()
-{
- TRACE("(%p)\n", this);
- return GetAutoArrange();
-}
-
HRESULT STDMETHODCALLTYPE CDefView::AddObject(PITEMID_CHILD pidl, UINT *item)
{
FIXME("(%p)->(%p %p) stub\n", this, pidl, item);