mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +02:00
[PowerRename][ImageResizer]Fallback for tier 1 menus (#19195)
* [PowerRename][ImageResizer]fallback for tier 1 menus * Simplify logic
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
#include "pch.h"
|
||||
#include "PowerRenameExt.h"
|
||||
#include "PowerRenameConstants.h"
|
||||
#include <trace.h>
|
||||
#include <Helpers.h>
|
||||
#include <common/themes/icon_helpers.h>
|
||||
@@ -64,29 +65,17 @@ HRESULT CPowerRenameMenu::QueryContextMenu(HMENU hMenu, UINT index, UINT uIDFirs
|
||||
if (!CSettingsInstance().GetEnabled())
|
||||
return E_FAIL;
|
||||
|
||||
// Win11 context menu can't distinguish between extended and default menu, so use this one
|
||||
if (package::IsWin11OrGreater())
|
||||
{
|
||||
if (CSettingsInstance().GetExtendedContextMenuOnly() && (uFlags & CMF_EXTENDEDVERBS))
|
||||
{
|
||||
// continue
|
||||
}
|
||||
else
|
||||
{
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Check if we should only be on the extended context menu
|
||||
if (CSettingsInstance().GetExtendedContextMenuOnly() && (!(uFlags & CMF_EXTENDEDVERBS)))
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
// Check if at least one of the selected items is actually renamable.
|
||||
if (!DataObjectContainsRenamableItem(m_spdo))
|
||||
return E_FAIL;
|
||||
|
||||
if (package::IsWin11OrGreater() && package::IsPackageRegistered(PowerRenameConstants::ModulePackageDisplayName))
|
||||
return E_FAIL;
|
||||
|
||||
// Check if we should only be on the extended context menu
|
||||
if (CSettingsInstance().GetExtendedContextMenuOnly() && (!(uFlags & CMF_EXTENDEDVERBS)))
|
||||
return E_FAIL;
|
||||
|
||||
HRESULT hr = E_UNEXPECTED;
|
||||
if (m_spdo && !(uFlags & (CMF_DEFAULTONLY | CMF_VERBSONLY | CMF_OPTIMIZEFORINVOKE)))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user