Add scanWindows function that retrieves all windows