DesktopUIControl.Active
From Xojo Documentation
Read-Only Property (As Boolean )
Indicates whether the DesktopUIControl is active.
Notes
Active is False when the DesktopUIControl's window is not in the foreground. When a DesktopWindow is deactivated, its controls are automatically deactivated unless AllowAutoDeactivate is set to False.