Skip to content

[Feature]: Add deterministic window bounds control to winapp ui #760

Description

Is your feature request related to a problem? Please describe.

winapp CLI 0.2.2-nmetulev-ui-command.54 can discover windows with winapp ui list-windows and capture them with winapp ui screenshot, but it cannot move or resize a target window. Automated screenshot pipelines need every app at identical geometry—for example, 1440x900 at a known screen location. Today callers must add a PowerShell or C# P/Invoke helper around SetWindowPos/MoveWindow, which adds environment-specific glue and breaks an otherwise coherent winapp ui workflow.

This is useful beyond one screenshot pipeline: repeatable visual tests, documentation screenshots, demos, and general UI automation all benefit from deterministic window geometry.

Describe the solution you'd like

Please add first-class window-bounds control under winapp ui. A unified command could look like:

winapp ui set-window-bounds -a MyApp --x 100 --y 100 --width 1440 --height 900 --json

Separate move/resize commands would also be reasonable if they better match the CLI's conventions. The operation should:

  • Support the existing -a/--app and -w/--window targeting model.
  • Report no target, ambiguous targets, and invalid bounds through clear errors rather than silently choosing or succeeding.
  • Return requested and actual bounds under --json, since Windows or the app may constrain the result.
  • Define whether coordinates and dimensions use physical pixels or DPI-scaled units, and whether bounds describe the outer window or client area.
  • Define behavior for minimized/maximized windows and app-enforced minimum-size constraints, including whether the command restores or clamps the window.

Additional context

A screenshot automation step could remain entirely within the CLI:

winapp ui set-window-bounds -a $app.ProcessId --x 100 --y 100 --width 1440 --height 900 --json
winapp ui screenshot -a $app.ProcessId --output "artifacts\$($app.Name).png" --json

This would make consistent capture across a large app suite straightforward without prescribing a particular Win32 implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions