-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# WindowHelpers | ||
|
||
This page is about the `WindowHelpers` class available in [`PeyrSharp.UiHelpers`](../ui-helpers.md). This page is about all of its methods. | ||
|
||
## Compatibility | ||
|
||
WindowHelpers are part of the `PeyrSharp.UiHelpers` module, which is compatible with all of these frameworks and platforms: | ||
|
||
| Package/Platform | Windows | macOS | Linux + others | | ||
| ---------------- | ---------- | ---------- | -------------- | | ||
| UiHelpers | ✅ | ❌ | ❌ | | ||
| **Framework** | **.NET 5** | **.NET 6** | **.NET 7** | | ||
| UiHelpers | ✅ | ✅ | ✅ | | ||
|
||
## Methods | ||
|
||
### GetWindows() | ||
|
||
#### Definition | ||
|
||
Retrieves a list of currently visible windows. | ||
|
||
#### Returns | ||
|
||
A list of `WindowInfo` objects representing the visible windows. | ||
|
||
#### Usage | ||
|
||
```c# | ||
using PeyrSharp.UiHelpers; | ||
using System.Collections.Generic; | ||
|
||
public class MyWindowManager | ||
{ | ||
public void PrintOpenedWindows() { | ||
List<WindowInfo> windows = WinFormsHelpers.GetWindows(); | ||
foreach (WindowInfo window in windows) | ||
{ | ||
Console.WriteLine(window.Name); | ||
} | ||
} | ||
} | ||
``` |