From f4cb10f5966470f90aeeb7d885e4737a72e89522 Mon Sep 17 00:00:00 2001 From: Whindmar Saksit Date: Tue, 8 Oct 2024 18:17:24 +0200 Subject: [PATCH] [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 3344ebfe0e5b5..95f4a9bff149b 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; }