feat(FileConverter): initial implementation of context menu file conversion (seeking feedback)#46786
feat(FileConverter): initial implementation of context menu file conversion (seeking feedback)#46786Pikachu-5 wants to merge 4 commits intomicrosoft:mainfrom
Conversation
|
@microsoft-github-policy-service agree |
|
Hello. I understand that this wasn’t discussed beforehand. But seeing many issues talking about it and no one taking on the job, i decided to work on it myself. I’m happy to:
Looking forward to your feedback |
There was a problem hiding this comment.
Pull request overview
Initial end-to-end implementation of a new FileConverter PowerToys module, adding a File Explorer context-menu entry that sends selected files to the Runner via a named pipe and performs image format conversion via WIC, with Settings UI integration and verification scripts.
Changes:
- Wires a new FileConverter module into Runner (module loading + settings window routing) and Settings UI (navigation + enable toggle).
- Adds FileConverter module components: conversion engine (WIC), module interface (pipe listener/dispatcher), and context-menu COM server (IExplorerCommand + legacy IContextMenu).
- Adds packaging/verification scripts (sparse package MSIX packing + smoke/negative tests) and module/localization resources.
Reviewed changes
Copilot reviewed 38 out of 47 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/Verification scripts/FileConverter/phase6-format-matrix-smoke.ps1 | Adds a format matrix smoke test that exercises multiple destinations via the named pipe. |
| tools/Verification scripts/FileConverter/phase3-queue-smoke.ps1 | Adds a queueing smoke test sending multiple requests to the named pipe. |
| tools/Verification scripts/FileConverter/negative-pipe-smoke.ps1 | Adds negative test cases for malformed/invalid pipe payloads. |
| src/settings-ui/Settings.UI/ViewModels/FileConverterViewModel.cs | Adds Settings UI ViewModel to toggle FileConverter enabled state via general settings IPC. |
| src/settings-ui/Settings.UI/Strings/en-us/Resources.resw | Adds Settings UI strings for FileConverter module title and shell navigation label. |
| src/settings-ui/Settings.UI/SettingsXAML/Views/ShellPage.xaml | Adds FileConverter entry to the Settings navigation view. |
| src/settings-ui/Settings.UI/SettingsXAML/Views/FileConverterPage.xaml.cs | Adds Settings page code-behind for FileConverter (view model wiring + refresh hook). |
| src/settings-ui/Settings.UI/SettingsXAML/Views/FileConverterPage.xaml | Adds Settings page UI for enabling FileConverter. |
| src/settings-ui/Settings.UI/SettingsXAML/App.xaml.cs | Adds Settings page routing for “FileConverter”. |
| src/settings-ui/Settings.UI/Helpers/ModuleGpoHelper.cs | Adds module type mapping for FileConverter (GPO unavailable + page type). |
| src/settings-ui/Settings.UI.Library/Helpers/ModuleHelper.cs | Adds FileConverter module icon mapping, enablement mapping, and module key mapping. |
| src/settings-ui/Settings.UI.Library/EnabledModules.cs | Adds FileConverter enable flag to General Settings enabled-modules model. |
| src/runner/settings_window.h | Adds FileConverter to the settings window enum. |
| src/runner/settings_window.cpp | Adds string <-> enum conversion for FileConverter settings window name. |
| src/runner/powertoy_module.cpp | Adjusts module DLL loading to retry with an exe-relative path when LoadLibrary fails. |
| src/runner/main.cpp | Adds FileConverter module interface DLL to the known modules list. |
| src/modules/FileConverter/Strings/en-us/Resources.resw | Adds FileConverter module strings (context menu labels + error text + engine messages). |
| src/modules/FileConverter/FileConverterModuleInterface/pch.h | Adds PCH for the module interface project. |
| src/modules/FileConverter/FileConverterModuleInterface/pch.cpp | Adds PCH translation unit for the module interface project. |
| src/modules/FileConverter/FileConverterModuleInterface/FileConverterModuleInterface.vcxproj | Adds build project for the module interface DLL. |
| src/modules/FileConverter/FileConverterModuleInterface/dllmain.cpp | Implements module interface: context menu registration + named pipe listener + dispatch to conversion engine. |
| src/modules/FileConverter/FileConverterLib/pch.h | Adds PCH for the conversion library project. |
| src/modules/FileConverter/FileConverterLib/pch.cpp | Adds PCH translation unit for the conversion library project. |
| src/modules/FileConverter/FileConverterLib/FileConverterLib.vcxproj | Adds static library project for the conversion engine/constants. |
| src/modules/FileConverter/FileConverterLib/FileConversionEngine.h | Declares WIC-based conversion API + format enum + result structure. |
| src/modules/FileConverter/FileConverterLib/FileConversionEngine.cpp | Implements WIC decoder/encoder conversion logic and encoder availability checks. |
| src/modules/FileConverter/FileConverterLib/Constants.h | Adds shared constants for pipe name, JSON keys, format tokens, and extensions. |
| src/modules/FileConverter/FileConverterContextMenu/Source.def | Exports COM entrypoints for the context menu DLL. |
| src/modules/FileConverter/FileConverterContextMenu/run-shell-verb-smoke.ps1 | Adds smoke test to invoke the context menu verb (Shell.Application + IExplorerCommand fallback). |
| src/modules/FileConverter/FileConverterContextMenu/pch.h | Adds PCH for the context menu project. |
| src/modules/FileConverter/FileConverterContextMenu/pch.cpp | Adds PCH translation unit for the context menu project. |
| src/modules/FileConverter/FileConverterContextMenu/pack-contextmenu-msix.ps1 | Adds packaging/signing/registration script for the sparse MSIX context menu package. |
| src/modules/FileConverter/FileConverterContextMenu/framework.h | Adds context menu project includes for COM/shell APIs. |
| src/modules/FileConverter/FileConverterContextMenu/FileConverterContextMenu.vcxproj | Adds build project for the context menu COM server DLL and assets/manifest inputs. |
| src/modules/FileConverter/FileConverterContextMenu/dllmain.cpp | Implements IExplorerCommand-based context menu with subcommands and pipe payload emission. |
| src/modules/FileConverter/FileConverterContextMenu/Assets/FileConverter/Wide310x150Logo.png | Adds sparse package tile asset. |
| src/modules/FileConverter/FileConverterContextMenu/Assets/FileConverter/storelogo.png | Adds sparse package store logo asset. |
| src/modules/FileConverter/FileConverterContextMenu/Assets/FileConverter/Square44x44Logo.png | Adds sparse package tile asset. |
| src/modules/FileConverter/FileConverterContextMenu/Assets/FileConverter/Square150x150Logo.png | Adds sparse package tile asset. |
| src/modules/FileConverter/FileConverterContextMenu/Assets/FileConverter/SplashScreen.png | Adds sparse package splash asset. |
| src/modules/FileConverter/FileConverterContextMenu/Assets/FileConverter/SmallTile.png | Adds sparse package tile asset. |
| src/modules/FileConverter/FileConverterContextMenu/Assets/FileConverter/LargeTile.png | Adds sparse package tile asset. |
| src/modules/FileConverter/FileConverterContextMenu/AppxManifest.xml | Adds sparse package manifest for Win11 context menu registration. |
| src/common/ManagedCommon/ModuleType.cs | Adds FileConverter to the shared module type enum. |
| PowerToys.slnx | Adds FileConverter projects to the solution build/dependency graph. |
| doc/images/disk-usage/add_remove_size_v0.66_converted.jpeg | Adds a converted JPEG image under docs (appears unrelated to FileConverter feature). |
src/settings-ui/Settings.UI/SettingsXAML/Views/FileConverterPage.xaml
Outdated
Show resolved
Hide resolved
tools/Verification scripts/FileConverter/phase6-format-matrix-smoke.ps1
Outdated
Show resolved
Hide resolved
src/modules/FileConverter/FileConverterContextMenu/AppxManifest.xml
Outdated
Show resolved
Hide resolved
|
Hey, thanks for pointing me to this. Yes, I realize I should’ve discussed it first. I mostly built this to try out the idea and see if it’s actually workable. I’m happy to move the discussion to the issue or adjust this PR however you’d prefer. Just let me know what makes the most sense from your side. |
|
Ready for review! I've fixed the issues Copilot caught and did a bit of housecleaning. I realized I mistakenly committed the nlohmann library headers in the previous commit, so I've stripped those out to keep the PR focused. Everything should be good to go now! |
Summary of the Pull Request
This PR introduces an initial implementation of a FileConverter module for PowerToys, including context menu integration, build setup, and module wiring.
I worked on this on my own to try and move the feature forward and make something concrete that could be reviewed. I didn’t get prior approval before starting, so I completely understand if changes or direction adjustments are needed.
I had commented on #36807 earlier but didn’t get a response, so I went ahead and built a working version.
Related issues:
PR Checklist
What this PR does
.reswRight now, this supports image conversion only.
If this direction is accepted, I was planning to extend it to:
How it works (quick overview)
IExplorerCommandwith a parent entry + subcommandsOne important fix:
ResourceLoaderin the constructor to prevent a startup crashI have attached a video for reference:
video.mp4
Validation
You can also just:
Notes / Trade-offs
Shell.Applicationis unreliable on newer Windows context menusFiles changed
dllmain.cpp(context menu + module interface)FileConversionEngine.cpp / .hConstants.h(new).vcxproj)Resources.reswrun-shell-verb-smoke.ps1What reviewers should focus on
Moderator Verification Plan
Run these in order from repo root.