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

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

# WindowClosedEventArgs.Window

Member of [WindowClosedEventArgs](https://help.ctrader.com/ctrader-algo/references/EventArgs/WindowClosedEventArgs/index.md).

## Window

The window the got closed

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

- CLI: Never raised in the CLI: the events that pass it never fire there (Window.Closed).
- Cloud: Never raised in the cloud: the events that pass it never fire there (Window.Closed).

C#:

```csharp
public Window Window {get;}
```

Python:

```python
windowClosedEventArgs.Window: Window
```

### Returns

`Window` — 

### Examples

C#:

```csharp
protected override void OnStart()
{
    var window = new Window { Title = "Trade Panel", Width = 300, Height = 200 };
    window.Closed += OnWindowClosed;
    window.Show();
}

private void OnWindowClosed(WindowClosedEventArgs args)
{
    Print("Window {0} closed at position ({1}, {2}), stopping", args.Window.Title, args.Window.Left, args.Window.Top);
    Stop();
}
```

Python:

```python
def on_start(self):
    window = Window()
    window.Title = "Trade Panel"
    window.Width = 300
    window.Height = 200
    window.Closed += self.on_window_closed
    window.Show()

def on_window_closed(self, args):
    api.Print(f"Window {args.Window.Title} closed at position ({args.Window.Left}, {args.Window.Top}), stopping")
    api.Stop()
```

