cleanup ForeignWindow