Skip to content

Conversation

fm-sys
Copy link

@fm-sys fm-sys commented Jul 20, 2025

Summary of the Pull Request

Adds a "screenshot" mode to Crop And Lock, which allows creating a window showing a freezed snapshot of the original window.

PR Checklist

Detailed Description of the Pull Request / Additional comments

It was asked why this feature is needed at all, because it could be done with snipping tool and just AoT that window as well. While this is true, PowerToys goal always was to improve and speed up workflows. Instead of capturing the screenshot, opening it, and then apply "Crop and Lock" or "Always on Top" on the screenshots window, this PR aims to provide this functionality in a single step.

Example use cases:

  • when I want to compare between two situations like previous output result and current output result. (Crop and Lock for screenshot  #31799)
  • Allow cropping a section of a large code file (say top while working at the bottom) as reference while working elsewhere in the file. (Crop and Lock, but with Lock #33071)
  • Can be useful for the work in the same document, like excel or word where you are actively checking the data from the same document. (Screenshot and lock #28633)
  • In lot's of older applications, if you need to get some information or data from one dialog do another, but because of dialog modality it's not possible to have both windows open at the same time. ("Temporary Screenshot" function #33812)
  • nowadays quite a lot is happening inside the browser. Quite often, I want to keep a small portion of the current website visible and switch to e.g. the writing tool also running in a different tab in the same browser window. (Crop and Lock for screenshot  #31799)

I've used win+ctrl+shift+s as the default activation shortcut, as it's not yet used by other powertoys utilities, has similarity with the normal win+shift+s shortcut hotkey and is consistent with the other Crop and Lock shortcuts win+ctrl+shift+r (Reparent Mode) and win+ctrl+shift+t (Thumbnail Mode).

Validation Steps Performed

Compatibility tested manually with a large set of applications I have installed on my computer. However, automated tests don't really make sense as there is not much business logic which could be tested.

This comment has been minimized.

@fm-sys
Copy link
Author

fm-sys commented Jul 20, 2025

@microsoft-github-policy-service agree

Copilot

This comment was marked as outdated.

@yeelam-gordon yeelam-gordon added the Product-CropAndLock Refers to the Crop and Lock PowerToys label Aug 20, 2025
@fm-sys fm-sys requested a review from Copilot August 20, 2025 22:25
Copilot

This comment was marked as outdated.

Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

check-spelling found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

This comment has been minimized.

@fm-sys fm-sys force-pushed the crop-and-lock-with-lock branch from 20d4c2e to 3e5ca9e Compare August 20, 2025 23:07

This comment has been minimized.

@fm-sys fm-sys force-pushed the crop-and-lock-with-lock branch from b37eff3 to af5b785 Compare August 20, 2025 23:28
@fm-sys fm-sys requested a review from Copilot August 20, 2025 23:32
Copy link
Contributor

@Copilot Copilot AI left a comment

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 a new "screenshot" mode to the Crop and Lock utility, allowing users to create a static, non-updating snapshot of a cropped window area. This complements the existing reparent and thumbnail modes by providing a frozen copy of the selected window region.

Key changes:

  • Adds new screenshot mode functionality with Win+Ctrl+Shift+S hotkey
  • Implements ScreenshotCropAndLockWindow class for capturing and displaying static screenshots
  • Updates settings UI to configure the new screenshot hotkey

Reviewed Changes

Copilot reviewed 18 out of 18 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/settings-ui/Settings.UI/ViewModels/CropAndLockViewModel.cs Adds ScreenshotActivationShortcut property to support configuring the screenshot hotkey
src/settings-ui/Settings.UI/Strings/en-us/Resources.resw Adds localization strings for screenshot mode UI elements
src/settings-ui/Settings.UI/SettingsXAML/Views/CropAndLockPage.xaml Adds UI control for screenshot hotkey configuration
src/settings-ui/Settings.UI/SettingsXAML/OOBE/Views/OobeCropAndLock.xaml Adds screenshot hotkey display to onboarding experience
src/settings-ui/Settings.UI/Library/CropAndLockProperties.cs Defines default screenshot hotkey and properties
src/modules/CropAndLock/CropAndLockModuleInterface/dllmain.cpp Adds screenshot hotkey handling and event processing
src/modules/CropAndLock/CropAndLock/trace.h Adds telemetry support for screenshot mode
src/modules/CropAndLock/CropAndLock/main.cpp Implements screenshot event handling and window creation
src/modules/CropAndLock/CropAndLock/ScreenshotCropAndLockWindow.h Header for new screenshot window implementation
src/modules/CropAndLock/CropAndLock/ScreenshotCropAndLockWindow.cpp Core implementation of screenshot capturing and display
src/common/interop/shared_constants.h Adds screenshot event constant for IPC communication
doc/devdocs/modules/cropandlock.md Updates documentation to include screenshot mode

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@yeelam-gordon
Copy link
Contributor

/azp run

Copy link

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@yeelam-gordon
Copy link
Contributor

There is a new Conflict Detection added, need to update accordingly:
https://github.com/microsoft/PowerToys/blob/main/doc/devdocs/core/settings/settings-implementation.md#shortcut-conflict-detection

@yeelam-gordon yeelam-gordon added this to the PowerToys 0.95 milestone Aug 22, 2025
@yeelam-gordon
Copy link
Contributor

/azp run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@fm-sys
Copy link
Author

fm-sys commented Sep 16, 2025

Hi @yeelam-gordon, anything which needs to be done from my side?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product-CropAndLock Refers to the Crop and Lock PowerToys
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants