Skip to content

HYMMA/WindowCapture

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A .NET global tool that captures screenshots of windows and browser tabs without bringing them to focus

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages