# setWindowSize(Object object)

Adjusts the size and position of a window in a gadget in window and window-semi modes
**Notice**：X and Y coordinates are always based on the screen where Feishu is located, no matter whether an external screen is connected. If the gadget is located in a different screen, setting either the X or Y coordinate will make it switch to the screen where Feishu is located.

## Support

App capability | Android | iOS | PC | Preview
---|---|---|---|---
Gadget | **X** | **X** | V4.3.0+ | Preview
Web app | **X** | **X** | V7.10.0+ | /

## Input

Inherits [standard object input](https://open.feishu.cn/document/uYjL24iN/ukzNy4SO3IjL5cjM), and has the following extension properties:

Name | Data type | Required | Default value | Description
---|---|---|---|---
windowWidth | number | No | &nbsp; | Window width, whose default value is the current window width<br>**Example value**: 800
windowHeight | number | No | &nbsp; | Window height, whose default value is the current window height<br>**Example value**: 1000
x | number | No | &nbsp; | X coordinate of the window (with the top left corner of the screen being the origin), whose default value is the X coordinate of the current window<br>**Example value**: 100
y | number | No | &nbsp; | Y coordinate of the window (with the top left corner of the screen being the origin), whose default value is the Y coordinate of the current window<br>**Example value**: 100

## Output

Inherits [standard object output](https://open.feishu.cn/document/uYjL24iN/ukzNy4SO3IjL5cjM#8c92acb8), without extension property

## Sample code

```js
tt.setWindowSize({
  windowWidth: 800,
  windowHeight: 1000,
  x: 100,
  y: 100,
  success(res) {
    console.log(JSON.stringify(res));
  },
  fail(res) {
    console.log(`setWindowSize fail: ${JSON.stringify(res)}`);
  },
});
```

Sample return object for `success`:

```json
{
  "errMsg": "setWindowSize:ok"
}
```

