Author: dquintana
Date: Thu May 22 19:13:15 2014
New Revision: 63415
URL:
http://svn.reactos.org/svn/reactos?rev=63415&view=rev
Log:
[BROWSEUI]
* Keep the call to TranslateAcceleratorSB within the shell browser, since it appears the
windows CDefView does not call it.
* "Hackplement" the backspace key as being the same as the "go up one
level" menu item. This does not seem to be exactly true in Windows, but it does the
job.
Modified:
branches/shell-experiments/dll/win32/browseui/lang/en-US.rc
branches/shell-experiments/dll/win32/browseui/resource.h
branches/shell-experiments/dll/win32/browseui/shellbrowser.cpp
branches/shell-experiments/dll/win32/shell32/shlview.cpp
Modified: branches/shell-experiments/dll/win32/browseui/lang/en-US.rc
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/lang/en-US.rc [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/lang/en-US.rc [iso-8859-1] Thu May 22
19:13:15 2014
@@ -119,6 +119,7 @@
"B", IDM_FAVORITES_ORGANIZEFAVORITES, VIRTKEY, CONTROL, NOINVERT
VK_LEFT, IDM_GOTO_BACK, VIRTKEY, ALT
VK_RIGHT, IDM_GOTO_FORWARD, VIRTKEY, ALT
+ VK_BACK, 41010, NOINVERT, VIRTKEY
"W", IDM_FILE_CLOSE, VIRTKEY, CONTROL, NOINVERT
"E", IDM_EXPLORERBAR_SEARCH, VIRTKEY, CONTROL, NOINVERT
"I", IDM_EXPLORERBAR_FAVORITES, VIRTKEY, CONTROL, NOINVERT
Modified: branches/shell-experiments/dll/win32/browseui/resource.h
URL:
http://svn.reactos.org/svn/reactos/branches/shell-experiments/dll/win32/bro…
==============================================================================
--- branches/shell-experiments/dll/win32/browseui/resource.h [iso-8859-1] (original)
+++ branches/shell-experiments/dll/win32/browseui/resource.h [iso-8859-1] Thu May 22
19:13:15 2014
@@ -22,6 +22,7 @@
#define IDM_FILE_CLOSE 0xA021
#define IDM_FILE_EXPLORE_MENU 0xA027
+#define IDM_BACKSPACE 0xA032
#define IDM_EXPLORE_ITEM_FIRST 0xA470
#define IDM_EXPLORE_ITEM_LAST 0xA570
#define IDM_FILE_EXPLORE_SEP 0xA028
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] Thu May 22
19:13:15 2014
@@ -332,6 +332,7 @@
IOleObject *fHistoryObject;
IStream *fHistoryStream;
IBindCtx *fHistoryBindContext;
+ HACCEL m_hAccel;
public:
#if 0
ULONG InternalAddRef()
@@ -615,6 +616,7 @@
virtual HRESULT STDMETHODCALLTYPE GetPositionCookie(DWORD *pdwPositioncookie);
// message handlers
+ LRESULT OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT OnInitMenuPopup(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled);
@@ -627,6 +629,7 @@
LRESULT OnGoBack(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled);
LRESULT OnGoForward(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled);
LRESULT OnGoUpLevel(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled);
+ LRESULT OnBackspace(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled);
LRESULT OnGoHome(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled);
LRESULT OnIsThisLegal(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL &bHandled);
LRESULT OnToggleStatusBarVisible(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL
&bHandled);
@@ -652,6 +655,7 @@
}
BEGIN_MSG_MAP(CShellBrowser)
+ MESSAGE_HANDLER(WM_CREATE, OnCreate)
MESSAGE_HANDLER(WM_DESTROY, OnDestroy)
MESSAGE_HANDLER(WM_SIZE, OnSize)
MESSAGE_HANDLER(WM_INITMENUPOPUP, OnInitMenuPopup)
@@ -675,6 +679,7 @@
COMMAND_ID_HANDLER(IDM_TOOLBARS_LINKSBAR, OnToggleLinksBandVisible)
COMMAND_ID_HANDLER(IDM_TOOLBARS_TEXTLABELS, OnToggleTextLabels)
COMMAND_ID_HANDLER(IDM_TOOLBARS_CUSTOMIZE, OnToolbarCustomize)
+ COMMAND_ID_HANDLER(IDM_BACKSPACE, OnBackspace)
COMMAND_RANGE_HANDLER(IDM_GOTO_TRAVEL_FIRSTTARGET, IDM_GOTO_TRAVEL_LASTTARGET,
OnGoTravel)
MESSAGE_HANDLER(WM_COMMAND, RelayCommands)
END_MSG_MAP()
@@ -1888,7 +1893,9 @@
HRESULT STDMETHODCALLTYPE CShellBrowser::TranslateAcceleratorSB(MSG *pmsg, WORD wID)
{
- return E_NOTIMPL;
+ if (!::TranslateAcceleratorW(m_hWnd, m_hAccel, pmsg))
+ return S_FALSE;
+ return S_OK;
}
HRESULT STDMETHODCALLTYPE CShellBrowser::BrowseObject(LPCITEMIDLIST pidl, UINT wFlags)
@@ -2249,7 +2256,8 @@
HRESULT STDMETHODCALLTYPE CShellBrowser::OnCreate(struct tagCREATESTRUCTW *pcs)
{
- return E_NOTIMPL;
+ m_hAccel = LoadAcceleratorsW(GetModuleHandle(L"browseui.dll"),
MAKEINTRESOURCEW(256));
+ return S_OK;
}
LRESULT STDMETHODCALLTYPE CShellBrowser::OnCommand(WPARAM wParam, LPARAM lParam)
@@ -2528,7 +2536,13 @@
HRESULT STDMETHODCALLTYPE CShellBrowser::v_MayTranslateAccelerator(MSG *pmsg)
{
- return fCurrentShellView->TranslateAcceleratorW(pmsg);
+ if (fCurrentShellView->TranslateAcceleratorW(pmsg) != S_OK)
+ {
+ if (TranslateAcceleratorSB(pmsg, 0) != S_OK)
+ return S_FALSE;
+ return S_OK;
+ }
+ return S_OK;
}
HRESULT STDMETHODCALLTYPE CShellBrowser::_GetBorderDWHelper(IUnknown *punkSrc, LPRECT
lprectBorder, BOOL bUseHmonitor)
@@ -3027,6 +3041,12 @@
HRESULT STDMETHODCALLTYPE CShellBrowser::GetPositionCookie(DWORD *pdwPositioncookie)
{
return E_NOTIMPL;
+}
+
+LRESULT CShellBrowser::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled)
+{
+ OnCreate(reinterpret_cast<LPCREATESTRUCT> (lParam));
+ return 0;
}
LRESULT CShellBrowser::OnDestroy(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
&bHandled)
@@ -3149,19 +3169,24 @@
return 0;
}
+LRESULT CShellBrowser::OnBackspace(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL
&bHandled)
+{
+ HRESULT hResult;
+
+ // FIXME: This does not appear to be what windows does.
+ hResult = NavigateToParent();
+ return 0;
+}
+
LRESULT CShellBrowser::OnIsThisLegal(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL
&bHandled)
{
HRESULT hResult;
typedef HRESULT (WINAPI *PSHOpenNewFrame)(LPITEMIDLIST pidl, IUnknown *b, long c,
long d);
- PSHOpenNewFrame Func;
- HMODULE hShlwapi;
-
- hShlwapi = LoadLibrary(TEXT("browseui.dll"));
- if (hShlwapi != NULL)
- Func = reinterpret_cast<PSHOpenNewFrame>(GetProcAddress(hShlwapi,
(LPCSTR)103));
- else
- Func = NULL;
+ PSHOpenNewFrame Func = NULL;
+ HMODULE Module = GetModuleHandle(TEXT("browseui.dll"));
+ if (Module != NULL)
+ Func = reinterpret_cast<PSHOpenNewFrame>(GetProcAddress(Module, (LPCSTR)
103));
if (Func != NULL)
{
LPITEMIDLIST desktopPIDL;
@@ -3300,7 +3325,7 @@
if (FAILED(hResult))
goto uninitialize;
- while (Ret = GetMessage(&Msg, NULL, 0, 0))
+ while ((Ret = GetMessage(&Msg, NULL, 0, 0)) != 0)
{
if (Ret == -1)
{
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] Thu May 22
19:13:15 2014
@@ -1923,10 +1923,6 @@
if (::TranslateAcceleratorW(m_hWnd, m_hAccel, lpmsg) != 0)
return S_OK;
- /* FIXME: should call TranslateAcceleratorSB */
-
- return m_pShellBrowser->TranslateAcceleratorSB(lpmsg, 0);
-
TRACE("-- key=0x04%lx\n", lpmsg->wParam) ;
}