doc/devdocs/common/context-menus.md
This document describes how context menu handlers are implemented in PowerToys, covering both Windows 10 and Windows 11 approaches.
PowerToys implements two types of context menu handlers:
Old-Style Context Menu Handlers
IContextMenu interfaceWindows 11 Context Menu Handlers
IExplorerCommand interfacePowerToys\x64\Debug\modules\<module>\<module>.msixPowerToys modules use two different approaches for registering context menu handlers:
AppManifest.xml in each context menu projectDllMain of the module interface DLL when the module is enabledGet-AppxPackage PowerShell command:
Get-AppxPackage -Name *PowerToys*
IExplorerCommand interfaceGetState: Determines visibility based on file typeInvoke: Handles the action when the menu item is clickedGetTitle: Provides the text to display in the context menuGetState methodPackageManager.AddPackageAsync