Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 31, 2026

  • Understand the codebase and existing functionality
  • Create ContextMenuUtilities.cs for Windows context menu integration via registry
  • Add "AddToContextMenu" setting in Settings.settings and Settings.Designer.cs
  • Add UI toggle for context menu integration in GeneralSettings page
  • Add test for context menu registry functionality
  • Improve error handling with Debug logging and user-friendly error messages
  • Run dependency validation to ensure changes don't break existing functionality
  • Run code review and address feedback
  • Add Windows 11 modern context menu support for packaged apps via Package.appxmanifest
    • Added uap3:FileTypeAssociation with custom verbs for image files
    • Added "Grab text with Text Grab" verb
    • Added "Open in Grab Frame" verb
  • Add "Open in Grab Frame" option for unpackaged apps
    • Added second context menu registry entry for GrabFrame
    • Added --grabframe command line argument support
    • Added GrabFrame constructor that accepts image file path
  • Address code review feedback
    • Use explicit HashSet of known flags instead of prefix matching
    • Add debug logging when --grabframe flag is used without valid file
    • Add path validation in GrabFrame constructor
    • Use Path.GetFullPath for reliable path resolution
    • Show user-friendly error messages when image files are not found
Original prompt

This section details on the original issue you should resolve

<issue_title>Enhancement idea: Grab text from image via context menu</issue_title>
<issue_description>I think it would be useful to have an option to have Text Grab integrate into the Windows context menu so you could right click on an image file and grab the text quickly.</issue_description>

Comments on the Issue (you are @copilot in this section)

@TheJoeFin I like this idea, very simple and quick which is the spirit of Text Grab. I'll look into how much work this would require. @TheJoeFin I have done some initial work on this but it looks like the context menu extension from SharpShell (https://github.com/dwmkerr/sharpshell) does not support .netcore3.1 yet. I'll keep an eye out for other routes or updates to that package.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 4 commits January 31, 2026 16:57
Co-authored-by: TheJoeFin <7809853+TheJoeFin@users.noreply.github.com>
Co-authored-by: TheJoeFin <7809853+TheJoeFin@users.noreply.github.com>
Co-authored-by: TheJoeFin <7809853+TheJoeFin@users.noreply.github.com>
…setting state management

Co-authored-by: TheJoeFin <7809853+TheJoeFin@users.noreply.github.com>
Copilot AI changed the title [WIP] Add context menu integration for text grab Add Windows context menu integration for grabbing text from images Jan 31, 2026
Copilot AI requested a review from TheJoeFin January 31, 2026 17:05
Updated MessageBox.Show calls to explicitly use System.Windows.MessageBoxButton.OK for improved clarity and to avoid ambiguity.
@TheJoeFin
Copy link
Owner

@copilot add modern Windows 11 context menu support for packaged apps. Add an option to open image in a Grab Frame

Copilot AI and others added 2 commits January 31, 2026 18:39
… in Grab Frame option

Co-authored-by: TheJoeFin <7809853+TheJoeFin@users.noreply.github.com>
…ation

Co-authored-by: TheJoeFin <7809853+TheJoeFin@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 31, 2026

@copilot add modern Windows 11 context menu support for packaged apps. Add an option to open image in a Grab Frame

Added in commits f93ea39 and dc96e4e:

Windows 11 modern context menu for packaged apps:

  • Updated Package.appxmanifest with uap3:FileTypeAssociation extension
  • Added two verbs: "Grab text with Text Grab" and "Open in Grab Frame"

"Open in Grab Frame" option:

  • For unpackaged apps: Added second registry entry Text-Grab.OpenInGrabFrame with --grabframe flag
  • For packaged apps: Added OpenInGrabFrame verb in manifest
  • Added --grabframe command line argument support
  • Added GrabFrame(string imagePath) constructor to load image files directly

Registry structure (unpackaged):

HKCU\Software\Classes\SystemFileAssociations\.png\shell\
  Text-Grab.GrabText\command = "Text-Grab.exe" "%1"
  Text-Grab.OpenInGrabFrame\command = "Text-Grab.exe" --grabframe "%1"

Co-authored-by: TheJoeFin <7809853+TheJoeFin@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants