mirror of
https://github.com/reactos/reactos.git
synced 2025-04-26 08:30:21 +00:00
[BROWSEUI] Fix backspace button behavior in win32 shell browser (#7837)
Update backspace button functionality to align with standard modern Windows behavior in the win32 shell browser.
This commit is contained in:
parent
1b564c1ba8
commit
9a0ff8b21b
1 changed files with 33 additions and 7 deletions
|
@ -3163,19 +3163,41 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::v_CheckZoneCrossing(LPCITEMIDLIST pidl)
|
|||
HRESULT STDMETHODCALLTYPE CShellBrowser::GoBack()
|
||||
{
|
||||
CComPtr<ITravelLog> travelLog;
|
||||
HRESULT hResult = GetTravelLog(&travelLog);
|
||||
CComPtr<ITravelEntry> unusedEntry;
|
||||
HRESULT hResult;
|
||||
|
||||
hResult = GetTravelLog(&travelLog);
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
hResult = travelLog->GetTravelEntry(static_cast<IDropTarget *>(this), TLOG_BACK, &unusedEntry);
|
||||
if (SUCCEEDED(hResult))
|
||||
{
|
||||
unusedEntry.Release();
|
||||
return travelLog->Travel(static_cast<IDropTarget *>(this), TLOG_BACK);
|
||||
}
|
||||
|
||||
return hResult;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CShellBrowser::GoForward()
|
||||
{
|
||||
CComPtr<ITravelLog> travelLog;
|
||||
HRESULT hResult = GetTravelLog(&travelLog);
|
||||
CComPtr<ITravelEntry> unusedEntry;
|
||||
HRESULT hResult;
|
||||
|
||||
hResult = GetTravelLog(&travelLog);
|
||||
if (FAILED_UNEXPECTEDLY(hResult))
|
||||
return hResult;
|
||||
|
||||
hResult = travelLog->GetTravelEntry(static_cast<IDropTarget *>(this), TLOG_FORE, &unusedEntry);
|
||||
if (SUCCEEDED(hResult))
|
||||
{
|
||||
unusedEntry.Release();
|
||||
return travelLog->Travel(static_cast<IDropTarget *>(this), TLOG_FORE);
|
||||
}
|
||||
|
||||
return hResult;
|
||||
}
|
||||
|
||||
HRESULT STDMETHODCALLTYPE CShellBrowser::GoHome()
|
||||
|
@ -3953,10 +3975,14 @@ LRESULT CShellBrowser::OnGoHome(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &
|
|||
|
||||
LRESULT CShellBrowser::OnBackspace(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled)
|
||||
{
|
||||
// FIXME: This does not appear to be what windows does.
|
||||
HRESULT hResult = NavigateToParent();
|
||||
HRESULT hResult;
|
||||
if (LOBYTE(GetVersion()) < 6)
|
||||
hResult = NavigateToParent();
|
||||
else if (FAILED(hResult = GoBack()))
|
||||
hResult = GoForward();
|
||||
|
||||
if (FAILED(hResult))
|
||||
TRACE("NavigateToParent failed with hResult=%08lx\n", hResult);
|
||||
TRACE("Backspace navigation failed with hResult=%08lx\n", hResult);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue