SetPosAndSize
CUTools
Description
Position and resize windows with pixel precision! SetPosAndSize enables the exact placement of windows at the coordinates you want, with a defined size - the perfect layout for multitasking and productivity!
With optional animations, Z-order control, and monitor support, you organize your desktop programmatically - consistent work environments at the push of a button!
Why This Tool Stands Out
- Pixel-Perfect Positioning
- Exact Size Specification in pixels
- Multi-Monitor support
- Instant Effect
Perfect for:
Power users, developers, and productivity enthusiasts who want to automate optimal work layouts. Ideal for multi-monitor setups, consistent test environments, and daily work routines.
Workflow support; time savings depend on the task
Instead of positioning and resizing windows manually, you load your optimal layout with a single command - perfect for the daily start or when switching projects.
JSON Parameters
- windowHandle REQUIRED (Integer)The window handle (HWND) of the window to position.
- x OPTIONAL (Integer)The new X position in screen coordinates.
- y OPTIONAL (Integer)The new Y position in screen coordinates.
- width OPTIONAL (Integer)The new width in pixels.
- height OPTIONAL (Integer)The new height in pixels.
- flags OPTIONAL (String)Additional flags: "noActivate", "showWindow", "async"
Example Call
{
"tool": "SetPosAndSize",
"params": {
"windowHandle": 123456,
"x": 100,
"y": 100,
"width": 1280,
"height": 720
}
}
Example Usage
Typical AI Command
- "Position the Visual Studio window on the left monitor at 1920x1080 pixels."
Return Values
The tool returns an object with the following properties:
- success (Boolean)
True if the operation was successful - previousX (Integer)
Previous X position - previousY (Integer)
Previous Y position - previousWidth (Integer)
Previous width - previousHeight (Integer)
Previous height - newX (Integer)
New X position - newY (Integer)
New Y position - newWidth (Integer)
New width - newHeight (Integer)
New height - error (String, optional)
Error message if the operation failed
Related Tools
Download CUTools
Get access to all 17 Computer Use tools for Windows automation.
Download Now