Files
PowerToys/doc/devdocs/modules/cropandlock.md
Gleb Khmyznikov 725535b760
Some checks failed
Spell checking / Check Spelling (push) Has been cancelled
Spell checking / Report (Push) (push) Has been cancelled
Spell checking / Report (PR) (push) Has been cancelled
Spell checking / Update PR (push) Has been cancelled
[DevDocs] More content and restructure (#40165)
## Summary of the Pull Request
Accumulated information from internal transition about the modules
development, and reworked it to be added in dev docs. Also the dev docs
intself was restructured to be more organized. New pages was
verified by transition team.

## PR Checklist
- [x] **Dev docs:** Added/updated

---------

Co-authored-by: Zhaopeng Wang (from Dev Box) <zhaopengwang@microsoft.com>
Co-authored-by: Hao Liu <liuhao3418@gmail.com>
Co-authored-by: Peiyao Zhao <105847726+zhaopy536@users.noreply.github.com>
Co-authored-by: Mengyuan <162882040+chenmy77@users.noreply.github.com>
Co-authored-by: zhaopeng wang <33367956+wang563681252@users.noreply.github.com>
Co-authored-by: Jaylyn Barbee <51131738+Jaylyn-Barbee@users.noreply.github.com>
2025-07-01 14:27:34 +02:00

2.3 KiB

Crop and Lock

Public overview - Microsoft Learn

All Issues
Bugs
Pull Requests

Overview

The Crop and Lock module in PowerToys allows users to crop a current application into a smaller window or create a thumbnail. This utility enhances productivity by enabling users to focus on specific parts of an application window.

Features

Thumbnail Mode

Creates a window showing the selected area of the original window. Changes in the original window are reflected in the thumbnail.

Reparent Mode

Creates a window that replaces the original window, showing only the selected area. The application is controlled through the cropped window.

Code Structure

Project Layout

The Crop and Lock module is part of the PowerToys solution. All the logic-related settings are in the main.cpp. The main implementations are in ThumbnailCropAndLockWindow and ReparentCropAndLockWindow. ChildWindow and OverlayWindow distinguish the two different modes of windows implementations.

Key Files

  • ThumbnailCropAndLockWindow.cpp: Defines the UI for the thumbnail mode.
  • OverlayWindow.cpp: Thumbnail module type's window concrete implementation.
  • ReparentCropAndLockWindow.cpp: Defines the UI for the reparent mode.
  • ChildWindow.cpp: Reparent module type's window concrete implementation.

Known Issues

  • Cropping maximized or full-screen windows in "Reparent" mode might not work properly.
  • Some UWP apps may not respond well to being cropped in "Reparent" mode.
  • Applications with sub-windows or tabs can have compatibility issues in "Reparent" mode.

Debug

  1. build the entire project
  2. launch the built Powertoys
  3. select CropAndLock as the startup project in VS
  4. In the debug button, choose "Attach to process". image
  5. Attach to CropAndLock.image