function to activate window by number