https://git.reactos.org/?p=reactos.git;a=commitdiff;h=f4cb10f5966470f90aeeb…
commit f4cb10f5966470f90aeeb7d885e4737a72e89522
Author: Whindmar Saksit <whindsaks(a)proton.me>
AuthorDate: Tue Oct 8 18:17:24 2024 +0200
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Oct 8 18:17:24 2024 +0200
[SHELL32] Remove view related items from File menu (#7429)
CORE-19778
---
dll/win32/shell32/CDefView.cpp | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/dll/win32/shell32/CDefView.cpp b/dll/win32/shell32/CDefView.cpp
index 3344ebfe0e5..95f4a9bff14 100644
--- a/dll/win32/shell32/CDefView.cpp
+++ b/dll/win32/shell32/CDefView.cpp
@@ -1807,11 +1807,15 @@ HRESULT CDefView::FillFileMenu()
return hr;
// TODO: filter or something
+ if (!selcount)
+ {
+ DeleteMenu(hmenu, FCIDM_SHVIEW_VIEW, MF_BYCOMMAND);
+ DeleteMenu(hmenu, FCIDM_SHVIEW_ARRANGE, MF_BYCOMMAND);
+ DeleteMenu(hmenu, FCIDM_SHVIEW_REFRESH, MF_BYCOMMAND);
+ }
Shell_MergeMenus(hFileMenu, hmenu, 0, 0, 0xFFFF, MM_ADDSEPARATOR |
MM_SUBMENUSHAVEIDS);
-
::DestroyMenu(hmenu);
-
return S_OK;
}