# WindowInfo

Import: `import com.install4j.api.windows.WindowInfo;`

```java
public class WindowInfo
```

Collection of methods to retrieve information about windows
on Microsoft Windows.

## Methods

| Signature | Returns | Description |
|---|---|---|
| [`getTopLevelWindows(long)`](#gettoplevelwindows-long) | `Collection<WindowInfo>` | Returns all visible top level windows of the process with the supplied process id. |
| [`isTabletMode()`](#istabletmode) | `boolean` | Checks if Windows 10 is currently used in tablet mode. |
| [`waitForMaximizableWindow(File, long, TimeUnit)`](#waitformaximizablewindow-file-long-timeunit) | `boolean` | Wait until a process with the given path displays a maximizable window. |
| [`getHwnd()`](#gethwnd) | `long` | Returns the window handle. |
| [`getStyle()`](#getstyle) | `int` | Returns the window style. |
| [`getClassName()`](#getclassname) | `String` | Returns the window class name. |
| [`getWindowTitle()`](#getwindowtitle) | `String` | Returns the window title. |
| [`toString()`](#tostring) | `String` |  |

### getTopLevelWindows(long)

```java
public static Collection<WindowInfo> getTopLevelWindows(long processId)
```

Returns all visible top level windows of the process with the supplied process id.


**Parameters:**

- `processId` — the process id

**Returns:** the top level windows or an empty list if the process does not exist.

### isTabletMode()

```java
public static boolean isTabletMode()
```

Checks if Windows 10 is currently used in tablet mode.


**Returns:** `true` if tablet mode is activated

### waitForMaximizableWindow(File, long, TimeUnit)

```java
public static boolean waitForMaximizableWindow(File executablePath, long timeout, TimeUnit unit)
```

Wait until a process with the given path displays a maximizable window. When Windows is in tablet mode,
you can use this method to delay the termination of an update downloader until a subsequently started installer can be displayed in full-screen mode.


**Parameters:**

- `executablePath` — the executable path
- `timeout` — a timeout value or 0 if no timeout should occur
- `unit` — the unit of the timeout value

**Returns:** `true` if a process with the given executable path was found that displays a maximizable window within the timeout period, `false` otherwise.

### getHwnd()

```java
public long getHwnd()
```

Returns the window handle.


**Returns:** the window handle

### getStyle()

```java
public int getStyle()
```

Returns the window style. This is the style int retrieved with `GetWindowLongPtr` and `GWL_STYLE`.


**Returns:** the style

### getClassName()

```java
public String getClassName()
```

Returns the window class name.


**Returns:** the class name

### getWindowTitle()

```java
public String getWindowTitle()
```

Returns the window title.


**Returns:** the title

### toString()

```java
public String toString()
```

