KeyRoutines
StepFreewindow.setState

Minimize, maximize or pin a window on top on Windows 11

Window state changes a window's state: restore, minimize, maximize, hide, close it, or keep it on top of other windows. It's the Swiss army knife for tidying windows from a routine.

How it works

  • Pick the window and the state; with "all" chosen as the pick, every matching window changes.
  • None of the changes bring the window to the front; while a full-screen app is in front, maximizing fills the screen instead so the game keeps focus.
  • Close uses the window's own close, so an app with unsaved work asks its usual question.
  • You can wait for a window that hasn't appeared yet, and the step reports which windows it changed.

Routines that use it

Always-on-top calculator

A hotkey opens Calculator with Open app and sets it to stay on top with Window state.

Hide the launcher

When your game starts, Window state minimizes the launcher window so it stays out of the way.

Close every Explorer window

At the end of the day, Window state closes all File Explorer windows before Lock the PC.

Settings

SettingWhat it does
WindowThe window to change.
StateRestore, minimize, maximize, hide or close it, or keep it on top.
Wait foradvancedWait this long for the window to appear.

Good to know

  • A protected game's windows are never changed; to close a game, use Close app.

Questions

How do I keep a window always on top in Windows 11?
Windows has no built-in option for most apps. Use Window state with "keep on top" in a routine, for example on a hotkey.
Can I minimize all windows of one app at once?
Yes. Set the window's pick to "all" and every matching window changes together.

Pairs well with

Build this routine in KeyRoutines

Free from the Microsoft Store for Windows 11 and 10. Pro is a one-time upgrade.