mirror of
https://github.com/reactos/reactos.git
synced 2025-02-20 15:35:04 +00:00
[EXPLORER] Fix crash on backspace while editing a label in the folder panel (#5059)
While editing a label, accelerator events should not be propagated.
This commit is contained in:
parent
e60c0f6970
commit
a777cc2cc4
2 changed files with 9 additions and 0 deletions
|
@ -149,6 +149,7 @@ CExplorerBand::CExplorerBand()
|
|||
, m_fVisible(FALSE)
|
||||
, m_bNavigating(FALSE)
|
||||
, m_dwBandID(0)
|
||||
, m_isEditing(FALSE)
|
||||
, m_pidlCurrent(NULL)
|
||||
{
|
||||
}
|
||||
|
@ -1217,6 +1218,9 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::HasFocusIO()
|
|||
|
||||
HRESULT STDMETHODCALLTYPE CExplorerBand::TranslateAcceleratorIO(LPMSG lpMsg)
|
||||
{
|
||||
if (m_isEditing)
|
||||
return S_FALSE;
|
||||
|
||||
if (lpMsg->hwnd == m_hWnd)
|
||||
{
|
||||
TranslateMessage(lpMsg);
|
||||
|
@ -1314,7 +1318,10 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM
|
|||
|
||||
hr = pParent->GetAttributesOf(1, &pChild, &dwAttr);
|
||||
if (SUCCEEDED(hr) && (dwAttr & SFGAO_CANRENAME) && theResult)
|
||||
{
|
||||
*theResult = 0;
|
||||
m_isEditing = TRUE;
|
||||
}
|
||||
return S_OK;
|
||||
}
|
||||
case TVN_ENDLABELEDITW:
|
||||
|
@ -1323,6 +1330,7 @@ HRESULT STDMETHODCALLTYPE CExplorerBand::OnWinEvent(HWND hWnd, UINT uMsg, WPARAM
|
|||
NodeInfo *info = GetNodeInfo(dispInfo->item.hItem);
|
||||
HRESULT hr;
|
||||
|
||||
m_isEditing = FALSE;
|
||||
if (theResult)
|
||||
*theResult = 0;
|
||||
if (dispInfo->item.pszText)
|
||||
|
|
|
@ -60,6 +60,7 @@ private:
|
|||
BOOL m_bNavigating;
|
||||
BOOL m_bFocused;
|
||||
DWORD m_dwBandID;
|
||||
BOOL m_isEditing;
|
||||
HIMAGELIST m_hImageList;
|
||||
HTREEITEM m_hRoot;
|
||||
HTREEITEM m_oldSelected;
|
||||
|
|
Loading…
Reference in a new issue