My script makes the last active window the active one once I click on an item in a listbox in a custom window (using /window -a...). The problem is, when I double click on the listbox after coming from a non-MIRC window I get an error /window: insufficient parameters because the last active window was not identified by MIRC, being foreign to MIRC. So, how do I trap this error and stop this from happening? I've tried to check if $lactive != $null but that doesn't work despite the fact that the $lactive returns nothing in this particular situation. Any ideas? I don't want my script to generate that kind of error.