> ## 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.

# If 窗口包含

## 指令说明

**描述：** 检测指定的元素是否包含在指定窗口中。

## 参数说明

<Tabs>
  <Tab title="常规">
    <img src="https://mintcdn.com/bazhuayu-rpa-docs/GBkSeqm2b688g4En/helpcenter/commands/condition/images/if-win-01-panel.png?fit=max&auto=format&n=GBkSeqm2b688g4En&q=85&s=c7ac991e72760c9659533fda006fd7c7" alt="If 窗口包含指令参数面板" width="660" height="382" data-path="helpcenter/commands/condition/images/if-win-01-panel.png" />

    | 参数           | 说明                                       |
    | ------------ | ---------------------------------------- |
    | **窗口对象**     | 根据目标元素自动匹配窗口或选择一个之前通过【获取窗口对象】指令创建的窗口对象   |
    | **检测指定窗口是否** | 包含 / 不包含元素                               |
    | **选择元素**     | 从元素库中选择一个已捕获的元素或通过「捕获新元素」来捕获新的窗口元素作为操作目标 |
  </Tab>

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

## 使用示例

<img src="https://mintcdn.com/bazhuayu-rpa-docs/GBkSeqm2b688g4En/helpcenter/commands/condition/images/if-win-02.png?fit=max&auto=format&n=GBkSeqm2b688g4En&q=85&s=905f620e578feee64b95c21c7e3a2ce1" alt="If 窗口包含 - 流程搭建" width="1186" height="500" data-path="helpcenter/commands/condition/images/if-win-02.png" />

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

获取标题为微信的窗口对象

判断窗口对象中是否包含指定窗口元素

若包含则执行【打印日志】指令点击窗口元素

否则执行【打印日志】指令打印 "窗口不包含元素"

### 效果展示

窗口包含目标元素时，流程进入对应的条件分支。

<img src="https://mintcdn.com/bazhuayu-rpa-docs/GBkSeqm2b688g4En/helpcenter/commands/condition/images/if-win-03.png?fit=max&auto=format&n=GBkSeqm2b688g4En&q=85&s=5c419153547cfb0782a1fd6c511013aa" alt="If 窗口包含效果展示" width="1185" height="353" data-path="helpcenter/commands/condition/images/if-win-03.png" />

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