---
id: "E:cAlgo.API.Window.Closed"
kind: "event"
type: "T:cAlgo.API.Window"
url: "https://help.ctrader.com/ctrader-algo/references/Controls/Windows/Window/Closed/"
---

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

# Window.Closed

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

## Closed

This event gets triggered when window is closed

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 event Action<WindowClosedEventArgs> Closed;
```

Python:

```python
window.Closed += handler  # handler(obj: WindowClosedEventArgs)
```

### Returns

`Action<WindowClosedEventArgs>` — 

### Examples

C#:

```csharp
var window = new Window { Title = "Settings", Width = 300, Height = 200 };
window.Closed += args => Print("Window '{0}' closed", args.Window.Title);
window.Show();
```

Python:

```python
def on_start(self):
    window = Window()
    window.Title = "Settings"
    window.Closed += self.on_window_closed
    window.Show()

def on_window_closed(self, args):
    api.Print(f"Window '{args.Window.Title}' closed")
```

