Widow – Diff between revs 6 and 7
?pathlinks?
Rev 6 | Rev 7 | |||
---|---|---|---|---|
Line 1... | Line 1... | |||
1 | using System; |
1 | using System; |
|
Line 2... | Line 2... | |||
2 | |
2 | |
|
3 | namespace Widow |
3 | namespace Widow |
|
4 | { |
4 | { |
|
5 | public class Apply : IDisposable |
5 | public class WindowRescale : IDisposable |
|
6 | { |
6 | { |
|
Line 7... | Line 7... | |||
7 | #region Public Enums, Properties and Fields |
7 | #region Public Enums, Properties and Fields |
|
Line 18... | Line 18... | |||
18 | |
18 | |
|
Line 19... | Line 19... | |||
19 | #endregion |
19 | #endregion |
|
Line 20... | Line 20... | |||
20 | |
20 | |
|
21 | #region Constructors, Destructors and Finalizers |
21 | #region Constructors, Destructors and Finalizers |
|
22 | |
22 | |
|
Line 23... | Line 23... | |||
23 | public Apply() |
23 | public WindowRescale() |
|
24 | { |
24 | { |
|
25 | } |
25 | } |
|
Line 26... | Line 26... | |||
26 | |
26 | |
|
27 | public Apply(MainForm mainForm) : this() |
27 | public WindowRescale(MainForm mainForm) : this() |
|
Line 28... | Line 28... | |||
28 | { |
28 | { |
|
29 | Form = mainForm; |
29 | Form = mainForm; |
|
30 | |
30 | |
|
31 | Form.WindowCreated += Form_WindowCreated; |
31 | Form.WindowCreated += Form_WindowCreated; |
|
Line 32... | Line 32... | |||
32 | } |
32 | } |
|
Line 62... | Line 62... | |||
62 | var hWnd = Helpers.FindWindowByTitle(window.Name); |
62 | var hWnd = Helpers.FindWindowByTitle(window.Name); |
|
63 | if (hWnd == IntPtr.Zero) |
63 | if (hWnd == IntPtr.Zero) |
|
64 | { |
64 | { |
|
65 | continue; |
65 | continue; |
|
66 | } |
66 | } |
|
- | 67 | |
||
- | 68 | Natives.MoveWindow(hWnd, window.Left, window.Top, window.Width, window.Height, true); |
||
- | 69 | } |
||
- | 70 | } |
||
- | 71 | |
||
- | 72 | #endregion |
||
- | 73 | |
||
- | 74 | #region Public Methods |
||
- | 75 | |
||
- | 76 | public void Apply() |
||
- | 77 | { |
||
- | 78 | foreach (var window in Windows.Window) |
||
- | 79 | { |
||
- | 80 | var hWnd = Helpers.FindWindowByTitle(window.Name); |
||
- | 81 | if (hWnd == IntPtr.Zero) |
||
- | 82 | { |
||
- | 83 | continue; |
||
- | 84 | } |
||
Line 67... | Line 85... | |||
67 | |
85 | |
|
68 | Natives.MoveWindow(hWnd, window.Left, window.Top, window.Width, window.Height, true); |
86 | Natives.MoveWindow(hWnd, window.Left, window.Top, window.Width, window.Height, true); |
|
69 | } |
87 | } |