forked from michaelmob/Hyperdesktop2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcls_Screen_Bounds.cs
39 lines (35 loc) · 1.14 KB
/
cls_Screen_Bounds.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Windows.Forms;
namespace hyperdesktop2
{
class Screen_Bounds
{
public static Rectangle bounds;
public static void load()
{
String[] bounds_arr = Settings.screen_res.Split(',');
bounds = new Rectangle(
Convert.ToInt32(bounds_arr[0]),
Convert.ToInt32(bounds_arr[1]),
Convert.ToInt32(bounds_arr[2]),
Convert.ToInt32(bounds_arr[3])
);
}
public static String reset()
{
var screen_bounds_temp = new Rectangle(0, 0, 0, 0);
foreach (var screen in Screen.AllScreens)
if (screen != Screen.PrimaryScreen)
screen_bounds_temp = Rectangle.Union(screen.Bounds, screen_bounds_temp);
return String.Format(
"{0},{1},{2},{3}",
screen_bounds_temp.Left,
screen_bounds_temp.Top,
SystemInformation.VirtualScreen.Width,
SystemInformation.VirtualScreen.Height
);
}
}
}