for mirc itself: $appactive / $appstate
for individual windows & chans: $window(bla).state ($active and $lactive might help, too)
for dialogs: $dialog(bla).active

Hum, why is there no $dialog(bla).state (as dialogs might be minimized, too)? confused