WindowCapture 1.0.0

dotnet tool install --global WindowCapture --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local WindowCapture --version 1.0.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=WindowCapture&version=1.0.0
                    
nuke :add-package WindowCapture --version 1.0.0
                    

WindowCapture

NuGet NuGet Downloads Build

A .NET global tool that captures screenshots of windows and browser tabs without bringing them to focus. Uses Win32 PrintWindow API for windows and Chrome DevTools Protocol (CDP) for browser tabs.

Install

dotnet tool install --global WindowCapture

Requires .NET 8+ on Windows.

Usage

Window Capture

# List all visible windows with their handle and size
windowcapture --list

# Capture a window by partial title match (case-insensitive)
windowcapture "Notepad"

# Capture a window by exact title
windowcapture "Untitled - Notepad" --exact

# Capture Visual Studio, Outlook, etc.
windowcapture "Visual Studio"
windowcapture "Inbox"
windowcapture "Teams"

Browser Tab Capture

# List all open browser tabs
windowcapture --tabs

# Capture a tab by title
windowcapture --tab "GitHub"
windowcapture --tab "Stack Overflow"

# Capture a tab by URL
windowcapture --tab "google.com"
windowcapture --tab "localhost:3000"

# Use a custom CDP port (default: 9222)
windowcapture --tabs --port 9223
windowcapture --tab "GitHub" --port 9223

Output

Screenshots are saved as PNG files in the system temp directory:

Screenshot saved: C:\Users\You\AppData\Local\Temp\screenshot_20260310_094405.png
Window: Notepad - Untitled

Browser Tab Setup

To capture browser tabs, the browser must be running with remote debugging enabled:

# Edge
msedge --remote-debugging-port=9222

# Chrome
chrome --remote-debugging-port=9222

Or enable permanently in edge://flags → "Enable remote debugging".

Features

  • Silent capture — does not bring the window to the foreground or change focus
  • Background windows — captures windows hidden behind others
  • Browser tabs — captures any tab, not just the active one (via CDP)
  • Partial matching — default search is case-insensitive substring match
  • No dependencies — single dotnet tool, no native binaries to install

Options

Option Description
--list List all visible windows
--tabs List all browser tabs (requires CDP)
--tab Capture a browser tab instead of a window
--exact Match title exactly instead of partial match
--port <num> CDP port (default: 9222)

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.0.0 118 3/10/2026