Uh oh!
There was an error while loading. Please reload this page.
Adds drop handler and MSI registration. - #218
Conversation
zooba
commented
Nov 12, 2025
Only a draft right now, because it doesn't load properly when installed via a test MSI (works fine if I hack in the registration). I need to do more testing, but can't do it right now. Isn't going to work at all for the MSIX, so this will also need a troublshooting entry over on the docs. |
zooba
commented
Nov 12, 2025
It works fine on a clean machine, so let's take it. |
There was a problem hiding this comment.
Pull Request Overview
This PR adds drag-and-drop support for Python files by implementing a new COM drop handler (DragDropSupport class) and registering it in both MSI and MSIX/AppX packages. When files are dragged onto a Python script, the drop handler will execute the script with the dropped files as arguments.
Key Changes:
- Implemented
DragDropSupportCOM class withIDropTargetandIPersistFileinterfaces - Added drop handler registration in MSI for
.pyand.pywfile types - Added context menu registration for
.pywfiles in AppX manifest - Added test coverage for argument parsing and drop description functionality
Reviewed Changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/pyshellext/shellext.cpp | Implements DragDropSupport COM class for handling drag-and-drop operations, including argument parsing from dropped files and execution logic |
| src/pyshellext/shellext.h | Adds function declarations for new drop-related helper functions |
| src/pyshellext/shellext_test.cpp | Adds Python test wrapper functions for the new drop argument parsing and description functions |
| tests/test_shellext.py | Adds unit tests for argument parsing (wide and ASCII) and drop description extraction |
| src/pymanager/msi.wxs | Registers the DragDropSupport COM class and associates it as a drop handler for Python.File and Python.NoConFile ProgIds |
| src/pymanager/appxmanifest.xml | Adds context menu verb registration for .pyw files using the EditInIdle command |
| _msbuild.py | Adds pathcch.lib dependency required for path manipulation in the drop handler |
| _msbuild_test.py | Adds pathcch.lib dependency and exports new test functions for the drop handler |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Fixes#217