GetWindowState
CUTools
Description
Determine the current state of any window! GetWindowState gives you detailed information about window state, position, size, and visibility - perfect for conditional automation and UI monitoring.
Check whether a window is minimized, maximized, active, or in the background. Always know exactly which application is displayed and how - the foundation for intelligent window control!
Why This Tool Stands Out
- Check Window State in real time
- Position & Size determined
- Visibility check
- Conditional Actions made possible
Perfect for:
Automation developers, QA testers, and power users who need to control conditional workflows based on window states. Ideal for intelligent UI automation and window management.
Workflow support; time savings depend on the task
Instead of searching for windows manually and checking their status, you get all the information with a single API call - immediately available for your automation logic.
JSON Parameters
- windowHandle REQUIRED (Integer)The window handle (HWND) of the window to check. Can be obtained via ListWindows or LocateAppWindow.
Example Call
{
"tool": "GetWindowState",
"params": {
"windowHandle": 123456
}
}
Example Usage
Typical AI Command
- "Check whether the Notepad window is maximized and bring it to the foreground if it is minimized."
Return Values
The tool returns an object with the following properties:
- success (Boolean)
True if the query was successful - windowState (String)
Current state: "normal", "minimized", "maximized" - isVisible (Boolean)
Whether the window is visible - isActive (Boolean)
Whether the window is active/focused - x (Integer)
X position of the window - y (Integer)
Y position of the window - width (Integer)
Width of the window - height (Integer)
Height of the window - error (String, optional)
Error message if the query failed
Related Tools
Download CUTools
Get access to all 17 Computer Use tools for Windows automation.
Download Now