> For the complete documentation index, see [llms.txt](https://docs.wisej.com/hybrid/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.wisej.com/hybrid/start/api/navigation/wisej.hybrid.devicewindows.md).

# DeviceWindows

Namespace: **Wisej.Hybrid**

Assembly: **Wisej.Hybrid** (3.5.0.0)

Provides methods to interact with device windows.

{% tabs %}
{% tab title="C#" %}

```csharp
public class DeviceWindows
```

{% endtab %}

{% tab title="VB.NET" %}

```visual-basic
Public Class DeviceWindows
```

{% endtab %}
{% endtabs %}

Access this class through the [Device](/hybrid/start/api/general/wisej.hybrid.device.md) singleton.

## Constructors

### ![](/files/CCV9PPenlC1YZvNh1I6R)DeviceWindows()

Initializes a new instance of [DeviceWindows](/hybrid/start/api/navigation/wisej.hybrid.devicewindows.md).

## Methods

### ![](/files/CCV9PPenlC1YZvNh1I6R)GetOpenWindows()

Gets an array of open window ids.

**Returns:** [String\[\]](https://docs.microsoft.com/dotnet/api/system.string). The ids.

### ![](/files/CCV9PPenlC1YZvNh1I6R)TryClose(id)

Tries to close a window with the given id.

| Parameter | Type                                                          | Description    |
| --------- | ------------------------------------------------------------- | -------------- |
| **id**    | [String](https://docs.microsoft.com/dotnet/api/system.string) | The window id. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). True if the window was successfully closed.

### ![](/files/CCV9PPenlC1YZvNh1I6R)TryOpen(url, title, location, size, minimumSize, maximumSize)

Tries to open a new window with the given URL.

| Parameter                                        | Type                                                                        | Description                     |
| ------------------------------------------------ | --------------------------------------------------------------------------- | ------------------------------- |
| **url**                                          | [String](https://docs.microsoft.com/dotnet/api/system.string)               | The URL to open.                |
| **title** ![](/files/hKoZkt511VItWvI9RDIT)       | [String](https://docs.microsoft.com/dotnet/api/system.string)               | The title of the window.        |
| **location** ![](/files/hKoZkt511VItWvI9RDIT)    | [Nullable\<Point>](https://docs.microsoft.com/dotnet/api/system.nullable-1) | The location of the window.     |
| **size** ![](/files/hKoZkt511VItWvI9RDIT)        | [Nullable\<Size>](https://docs.microsoft.com/dotnet/api/system.nullable-1)  | The size of the window.         |
| **minimumSize** ![](/files/hKoZkt511VItWvI9RDIT) | [Nullable\<Size>](https://docs.microsoft.com/dotnet/api/system.nullable-1)  | The minimum size of the window. |
| **maximumSize** ![](/files/hKoZkt511VItWvI9RDIT) | [Nullable\<Size>](https://docs.microsoft.com/dotnet/api/system.nullable-1)  | The maximum size of the window. |

**Returns:** [String](https://docs.microsoft.com/dotnet/api/system.string). The ID of the new window or null if not created.

### ![](/files/CCV9PPenlC1YZvNh1I6R)TryPostMessage(id, data)

Tries to post a message to the given window id with the given payload.

| Parameter | Type                                                          | Description       |
| --------- | ------------------------------------------------------------- | ----------------- |
| **id**    | [String](https://docs.microsoft.com/dotnet/api/system.string) | The window id.    |
| **data**  | [String](https://docs.microsoft.com/dotnet/api/system.string) | The data to post. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). True if the message was sent successfully.

### ![](/files/CCV9PPenlC1YZvNh1I6R)TrySetTitle(id, title)

Tries to set the title for the given window.

| Parameter | Type                                                          | Description                  |
| --------- | ------------------------------------------------------------- | ---------------------------- |
| **id**    | [String](https://docs.microsoft.com/dotnet/api/system.string) | The window id.               |
| **title** | [String](https://docs.microsoft.com/dotnet/api/system.string) | The new title of the window. |

**Returns:** [Boolean](https://docs.microsoft.com/dotnet/api/system.boolean). True if the action succeeded.

## Events

### ![](/files/CCV9PPenlC1YZvNh1I6R)ClosedWindow

[EventHandler\<String>](https://docs.microsoft.com/dotnet/api/system.eventhandler-1) Fires when a window is closed.

### ![](/files/CCV9PPenlC1YZvNh1I6R)NewWindow

[EventHandler\<String>](https://docs.microsoft.com/dotnet/api/system.eventhandler-1) Fires when a new window is created and shown.

### ![](/files/CCV9PPenlC1YZvNh1I6R)ReceivedMessage

[EventHandler\<String>](https://docs.microsoft.com/dotnet/api/system.eventhandler-1) Fires when the current window receives a message from another window.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.wisej.com/hybrid/start/api/navigation/wisej.hybrid.devicewindows.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
