Refactored/simplified check whether windows are responding.