pc.windows covers the desktop’s top-level windows, as the taskbar lists them. Each is a Window. Bounds are screen pixels.
pc.processes.start("notepad.exe")
note = pc.windows.wait_for(process="notepad.exe")
note.set_bounds(x=0, y=0, width=960, height=1040)
note.focus()

windows.list()

Every top-level window, front to back. Returns list[Window].

windows.find()

The first window whose title contains title (case-insensitive) and whose process is process. Doesn’t wait.
windows.find(*, title=None, process=None)
Returns Window | None.

windows.wait_for()

Wait until a matching window exists, and return it.
windows.wait_for(*, title=None, process=None, timeout=None)
ParameterTypeDefaultDescription
titlestr | NoneNonePart of the title, case-insensitive.
processstr | NoneNoneThe program’s file name, such as "notepad.exe".
timeoutfloat | None5000Milliseconds, at most 60,000.
Give title, process or both. Returns Window. Raises TimeoutError when none appears in time.

windows.focused

The window with focus. Returns Window | None.

windows.focus(), minimize(), maximize(), restore()

Act on the window with id window_id.
windows.focus(window_id)
windows.minimize(window_id)
windows.maximize(window_id)
windows.restore(window_id)
Returns the Window afterwards, or None if it no longer exists.

windows.set_bounds()

Move and resize a window. An omitted field keeps its value; a maximized window is restored first.
windows.set_bounds(window_id, *, x=None, y=None, width=None, height=None)
Returns Window | None.

windows.close()

Ask the window to close, as its close button does.
windows.close(window_id)
Returns None once it has closed. A window that declines (a “save changes?” prompt) stays open, and is returned as it is.

Window

One top-level window. A dataclass.
FieldTypeDescription
idstrThe window’s id.
titlestrIts title.
processstrThe program’s file name, such as "notepad.exe".
pidintIts process id.
x, y, width, heightintIts visible frame, in screen pixels.
statestr"normal", "minimized" or "maximized".
focusedboolWhether it has focus.

window.center

Returns (x, y), the centre of the window.

window.focus(), minimize(), maximize(), restore(), close(), set_bounds()

The same as the windows methods, for this window.
window.set_bounds(*, x=None, y=None, width=None, height=None)
Each returns the window afterwards, or None once it is gone. A Window holds the values from when it was read: call windows.list() or the action again for current ones.