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

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

# Window.Activated

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

## Activated

This event gets triggered when window is activated

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<WindowActivatedEventArgs> Activated;
```

Python:

```python
window.Activated += handler  # handler(obj: WindowActivatedEventArgs)
```

### Returns

`Action<WindowActivatedEventArgs>` — 

### Examples

C#:

```csharp
var window = new Window { Title = "Order entry", Width = 300, Height = 200 };
window.Activated += args => Print("Window '{0}' activated", args.Window.Title);
window.Show();
```

Python:

```python
def on_start(self):
    window = Window()
    window.Title = "Order entry"
    window.Activated += self.on_window_activated
    window.Show()

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

