doc/devdocs/modules/zoomit.md
Public overview - Microsoft Learn
ZoomIt is a screen zoom and annotation tool originally from Microsoft's Sysinternals suite. It allows users to:
ZoomIt runs in the background and is activated via customizable hotkeys.
Unlike other PowerToys modules, ZoomIt has some unique integration aspects:
Registry-based Settings: ZoomIt uses registry settings instead of JSON files (which is the standard for other PowerToys modules). This was required to maintain compatibility with the standalone Sysinternals version.
Dual Source of Truth: The PowerToys repository serves as the source of truth for both the PowerToys version and the standalone Sysinternals version, with build flags to differentiate between them.
Settings Integration: A special WinRT/C++ interop library was developed to bridge between PowerToys' JSON-based settings system and ZoomIt's registry-based settings.
The ZoomIt module consists of the following components:
ZoomIt Executable (PowerToys.ZoomIt.exe): The main ZoomIt application that provides the zooming and annotation functionality.
Module Interface (PowerToys.ZoomItModuleInterface.dll): Implements the PowerToys module interface to integrate with the PowerToys runner.
Settings Interop (ZoomItSettingsInterop): A WinRT/C++ interop library that enables communication between PowerToys settings and ZoomIt's registry settings.
src/
├── modules/
│ └── ZoomIt/
│ ├── ZoomIt/ # Main ZoomIt application code
│ ├── ZoomItModuleInterface/ # PowerToys module interface implementation
│ └── ZoomItSettingsInterop/ # WinRT/C++ interop for settings
├── settings-ui/
│ └── Settings.UI/
│ ├── SettingsXAML/
│ │ └── Views/
│ │ └── ZoomItPage.xaml # ZoomIt settings page UI
│ └── ViewModels/
│ └── ZoomItViewModel.cs # ZoomIt settings view model
└── common/
└── sysinternals/ # Common code from Sysinternals
ZoomIt's settings are stored in the Windows registry instead of JSON files to maintain compatibility with the standalone version. The settings include:
The ZoomItSettingsInterop library handles:
The integration of ZoomIt into PowerToys involved these key steps:
Code Migration:
src/modules/ZoomIt/ZoomItsrc/common/sysinternalsModule Interface Implementation:
Settings Integration:
ZoomItSettingsInterop as a bridge between registry and JSON settingsPowerToys Integration:
UI/UX Adjustments:
Build System Updates:
runner as the startup project and start debugging.ZoomIt as the startup project in Visual Studio.Ctrl + Alt + P and attach ZoomIt to the process.ZoomIt requires storing font information as a binary LOGFONT structure in the registry. This required special handling:
ZoomIt registers hotkeys through the Windows RegisterHotKey API. Special handling was needed to:
Communication between PowerToys and ZoomIt uses:
Several challenges were encountered during ZoomIt integration:
First-Run Behavior:
Settings Synchronization:
File Interaction:
Drawing Issues:
Dual-Build Support:
The PowerToys repository serves as the source of truth for both PowerToys and Sysinternals standalone versions of ZoomIt. Key repositories involved:
https://dev.azure.com/sysinternals/Tools/_git/ZoomIthttps://dev.azure.com/sysinternals/Tools/_git/CommonThe integration process can be tracked through PR #35880 which contains the complete history of changes required to properly integrate ZoomIt.