> ## Documentation Index
> Fetch the complete documentation index at: https://rpa.bazhuayu.com/helpcenter/llms.txt
> Use this file to discover all available pages before exploring further.

# 关闭窗口

## 指令说明

**描述：** 关闭指定窗口。

## 参数说明

<Tabs>
  <Tab title="常规">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/At1Bhn6G7IYQARg7/helpcenter/commands/desktop-automation/images/closewindowcommand-01.png?fit=max&auto=format&n=At1Bhn6G7IYQARg7&q=85&s=20b3cd3502ed166992adac4969cf069b" alt="关闭窗口指令参数面板" width="660" height="326" data-path="helpcenter/commands/desktop-automation/images/closewindowcommand-01.png" />

    | 参数         | 说明                                                                 |
    | ---------- | ------------------------------------------------------------------ |
    | **获取窗口方式** | 选择获取窗口方式：窗口对象、窗口标题或类型名、捕获窗口元素                                      |
    | **窗口对象**   | 输入一个通过"获取窗口对象"获取的窗口对象                                              |
    | **窗口标题**   | 输入窗口标题，可添加窗口类型、正则匹配                                                |
    | **窗口类型**   | 输入窗口类型，窗口类型可借助工具FlaUInspect（自行从GitHub上拉取）获取，桌面软件的ClassName属性就是窗口类型 |
    | **选择元素**   | 选择要操作的目标元素                                                         |
  </Tab>

  <Tab title="高级">
    本指令暂无高级参数。
  </Tab>
</Tabs>

## 使用示例

<img src="https://mintcdn.com/bazhuayu-rpa-docs/At1Bhn6G7IYQARg7/helpcenter/commands/desktop-automation/images/closewindowcommand-02.png?fit=max&auto=format&n=At1Bhn6G7IYQARg7&q=85&s=78197e531809425f8fe5805e8a8be5ba" alt="关闭窗口使用示例 - 流程搭建" width="851" height="157" data-path="helpcenter/commands/desktop-automation/images/closewindowcommand-02.png" />

**该流程执行逻辑：**

使用【获取窗口对象】获取标题为Excel.xlsx-WPS Office的窗口，将窗口对象保存到窗口对象 → 使用【关闭窗口】关闭窗口。

### 效果展示

成功关闭指定的窗口。

<img src="https://mintcdn.com/bazhuayu-rpa-docs/At1Bhn6G7IYQARg7/helpcenter/commands/desktop-automation/images/closewindowcommand-03.png?fit=max&auto=format&n=At1Bhn6G7IYQARg7&q=85&s=c2d328086e365cfb4d0f46a27d598f12" alt="关闭窗口使用示例 - 效果展示" width="850" height="194" data-path="helpcenter/commands/desktop-automation/images/closewindowcommand-03.png" />

<Info>
  使用指令过程中遇到问题？前往 [八爪鱼RPA 开发者社区问答板块](https://rpa.bazhuayu.com/community/questions) 提问，获取官方与社区帮助。
</Info>
