capture_window
Capture a window by handle, process ID, name, or title substring. Use 'print' method to capture occluded or minimized windows without stealing focus.
Instructions
Capture a window by hwnd, pid, process name, or title substring. captureMethod 'print' works on occluded/minimized windows. noActivate avoids stealing focus.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| hwnd | No | Window handle from list_windows or launch_app. Numbers are accepted at runtime, but strings are safest for Codex. | |
| pid | No | ||
| processName | No | ||
| titleContains | No | ||
| region | No | Optional rectangle relative to the target window top-left corner. | |
| focus | No | Bring the window to the foreground before capturing. Set false to preserve open menus, popups, or transient UI. | |
| captureMethod | No | Capture method: 'screen' uses CopyFromScreen (needs visible area), 'print' uses PrintWindow API (captures window content even behind other windows). | screen |
| noActivate | No | When true with captureMethod 'screen', the window is raised above overlapping windows without stealing keyboard focus, then restored after capture. | |
| outputPath | No | Optional absolute PNG output path. |