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

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

# WindowDeactivatedEventArgs.Window

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

## Window

The window that got deactivated

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

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

C#:

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

Python:

```python
windowDeactivatedEventArgs.Window: Window
```

### Returns

`Window` — 

### Examples

C#:

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

private void OnWindowDeactivated(WindowDeactivatedEventArgs args)
{
    args.Window.Topmost = true;
    Print("Window is active: {0}, kept on top", args.Window.IsActive);
}
```

Python:

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

def on_window_deactivated(self, args):
    args.Window.Topmost = True
    api.Print(f"Window is active: {args.Window.IsActive}, kept on top")
```

