---
id: "P:cAlgo.API.Window.WindowState"
kind: "property"
type: "T:cAlgo.API.Window"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/Windows/Window/WindowState/"
---

> Documentation index for agents: https://help.ctrader.com/ctrader-algo/llms.txt · machine index: https://help.ctrader.com/ctrader-algo/api.json

# Window.WindowState

Member of [Window](https://help.ctrader.com/ctrader-algo/references/Controls/Windows/Window/index.md).

## WindowState

Get / Set the window state

Environments: Desktop supported · CLI not supported · Cloud not supported.

- CLI: Never shown: Show, Hide and Close send nothing; IsVisible stays false and window events never fire.
- Cloud: Never shown: Show, Hide and Close send nothing; IsVisible stays false and window events never fire.

C#:

```csharp
public WindowState WindowState {get; set;}
```

Python:

```python
window.WindowState: WindowState
```

### Returns

`WindowState` — 

### Examples

C#:

```csharp
var window = new Window { Title = "Log", Width = 400, Height = 300 };
window.Show();
window.WindowState = WindowState.Minimized;
Print("Window state: {0}", window.WindowState);
```

Python:

```python
window = Window()
window.Title = "Log"
window.Width = 400
window.Height = 300
window.Show()
window.WindowState = WindowState.Minimized
api.Print(f"Window state: {window.WindowState}")
```

