---
title: "destroyWindow"
canonical: "https://help.vicon.com/space/Shogun17/13536477/destroyWindow"
format: markdown
---
# Description

Destroys a docking user window, which was previously created by calling [createWindow](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13537601).

When a user window is destroyed, all of its forms and controls are destroyed along with it. Thus, only the user window itself needs to be destroyed.

Upon shut down, Shogun Post automatically destroys all user windows.

## Functional area

User Window

# Command syntax

## Syntax

|  |
| --- |
| `destroyWindow userWindowID` |

### Arguments

| **Name** | **Type** | **Required** | **Comments** |
| --- | --- | --- | --- |
| `windowId` | int | yes | The user window ID previously obtained from calling [createWindow](https://vicon-help.atlassian.net/wiki/spaces/Shogun17/pages/13537601). |

### Flags

None

## Return value

void

> Macro (scroll-pagebreak)

## Examples

```plaintext
// Create and Destroy a user window
int $windowId;
  
// Create the user window
$windowId = `createWindow "MyWindow"`;
 
// ... and immediately destroy it
destroyWindow $windowId;
```