Window.Deactivate
From Xojo Documentation
Event
The window is being deactivated. For example, a window belonging to another app is being activated.
The window is being deactivated. For example, a window belonging to another app is being activated.