Using Triggers to Respond to Window Events at Runtime
You can use the following triggers to respond to window events:
When-Window-Activated
When-Window-Closed
When-Window-Deactivated
When-Window-Resized
When working with these triggers, you can examine the Built-in system variable SYSTEM.EVENT_WINDOW to determine the name of the window for which the trigger fired.