https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ff63d064066778861eb63…
commit ff63d064066778861eb630d553660737dca5a33e
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Mon Aug 28 00:12:47 2023 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Mon Aug 28 00:12:47 2023 +0900
[BROWSEUI] Support mouse back and forward buttons (#5623)
Add WM_APPCOMMAND handling to the
shell browser. CORE-16776
---
dll/win32/browseui/shellbrowser.cpp | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/dll/win32/browseui/shellbrowser.cpp b/dll/win32/browseui/shellbrowser.cpp
index 0f1e3814ebe..f6cb992dbb6 100644
--- a/dll/win32/browseui/shellbrowser.cpp
+++ b/dll/win32/browseui/shellbrowser.cpp
@@ -626,6 +626,7 @@ public:
LRESULT RelayCommands(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL &bHandled);
LRESULT OnSettingsChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled);
LRESULT OnGetSettingsPtr(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled);
+ LRESULT OnAppCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled);
HRESULT OnSearch();
static ATL::CWndClassInfo& GetWndClassInfo()
@@ -678,6 +679,7 @@ public:
MESSAGE_HANDLER(WM_COMMAND, RelayCommands)
MESSAGE_HANDLER(BWM_SETTINGCHANGE, OnSettingsChange)
MESSAGE_HANDLER(BWM_GETSETTINGSPTR, OnGetSettingsPtr)
+ MESSAGE_HANDLER(WM_APPCOMMAND, OnAppCommand)
END_MSG_MAP()
BEGIN_CONNECTION_POINT_MAP(CShellBrowser)
@@ -3812,6 +3814,27 @@ LRESULT CShellBrowser::OnGetSettingsPtr(UINT uMsg, WPARAM wParam,
LPARAM lParam,
return NO_ERROR;
}
+// WM_APPCOMMAND
+LRESULT CShellBrowser::OnAppCommand(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
bHandled)
+{
+ UINT uCmd = GET_APPCOMMAND_LPARAM(lParam);
+ switch (uCmd)
+ {
+ case APPCOMMAND_BROWSER_BACKWARD:
+ GoBack();
+ break;
+
+ case APPCOMMAND_BROWSER_FORWARD:
+ GoForward();
+ break;
+
+ default:
+ FIXME("uCmd: %u\n", uCmd);
+ break;
+ }
+ return 0;
+}
+
HRESULT CShellBrowser_CreateInstance(REFIID riid, void **ppv)
{
return ShellObjectCreatorInit<CShellBrowser>(riid, ppv);