Skip to content

Adds drop handler and MSI registration. - #218

Merged
zooba merged 2 commits into
python:mainfrom
zooba:gh-217
Nov 13, 2025
Merged

Adds drop handler and MSI registration.#218
zooba merged 2 commits into
python:mainfrom
zooba:gh-217

Conversation

@zooba

@zooba zooba commented Nov 12, 2025

Copy link
Copy Markdown
Member

Fixes #217

@zooba

zooba commented Nov 12, 2025

Copy link
Copy Markdown
Member Author

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
zooba marked this pull request as ready for review November 12, 2025 23:16
@zooba

zooba commented Nov 12, 2025

Copy link
Copy Markdown
Member Author

It works fine on a clean machine, so let's take it.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DragDropSupport COM class with IDropTarget and IPersistFile interfaces
  • Added drop handler registration in MSI for .py and .pyw file types
  • Added context menu registration for .pyw files 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.

Comment thread src/pyshellext/shellext.cpp
Comment thread src/pyshellext/shellext.cpp
Comment thread src/pyshellext/shellext.cpp
Comment thread src/pyshellext/shellext.cpp
Comment thread src/pyshellext/shellext.cpp Outdated
Comment thread src/pyshellext/shellext.cpp
Comment thread src/pyshellext/shellext.cpp Outdated
Comment thread src/pyshellext/shellext.cpp Outdated
Comment thread src/pyshellext/shellext.cpp
@zooba
zooba merged commit 2cd04aa into python:main Nov 13, 2025
4 checks passed
@zooba
zooba deleted the gh-217 branch November 13, 2025 21:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants