Recognize active/inactive window