> ## 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/setwindowstatecommand-01.png?fit=max&auto=format&n=At1Bhn6G7IYQARg7&q=85&s=b158f8c21528176147423f54830b2afc" alt="设置窗口状态指令参数面板" width="645" height="351" data-path="helpcenter/commands/desktop-automation/images/setwindowstatecommand-01.png" />

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

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

## 使用示例

<img src="https://mintcdn.com/bazhuayu-rpa-docs/W742rR5fGwXr1akA/helpcenter/commands/desktop-automation/images/setwindowstatecommand-02.png?fit=max&auto=format&n=W742rR5fGwXr1akA&q=85&s=5cd159714f5a829b52538f0f6c2ecb59" alt="设置窗口状态使用示例 - 流程搭建" width="852" height="161" data-path="helpcenter/commands/desktop-automation/images/setwindowstatecommand-02.png" />

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

获取标题为Excel.xlsx-WPS Office的窗口对象 → 使用【设置窗口状态】指令将窗口对象最大化。

### 效果展示

窗口状态已成功设置为最大化。

<img src="https://mintcdn.com/bazhuayu-rpa-docs/W742rR5fGwXr1akA/helpcenter/commands/desktop-automation/images/setwindowstatecommand-03.png?fit=max&auto=format&n=W742rR5fGwXr1akA&q=85&s=04e38b595e488b5a2009c172a061bd85" alt="设置窗口状态使用示例 - 效果展示" width="843" height="187" data-path="helpcenter/commands/desktop-automation/images/setwindowstatecommand-03.png" />

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