How do I check that the active window is a query window?