# IsValid()

> Returns true if this window is valid and not destroyed.

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.Windowing](/engine/6000.7/script-reference/unityengine/windowing.md)
* **Assembly:** UnityEngine.WindowingModule

```csharp
public bool IsValid()
```

### Returns

| Type                                                          | Description                                     |
| ------------------------------------------------------------- | ----------------------------------------------- |
| [bool](https://learn.microsoft.com/dotnet/api/system.boolean) | True if this window is valid and not destroyed. |

### Examples

```csharp
using UnityEngine;
using UnityEngine.Windowing;

public class IsWindowValidExample : MonoBehaviour
{
    void Start()
    {
        var window = GameWindow.Main;
        bool valid = window.IsValid();
        Debug.Log($"Is window valid: {valid}");
    }
}
```
