51 lines
1.6 KiB
C#
51 lines
1.6 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Linq;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Remontor.Connector
|
|
{
|
|
internal class OffMon : IModeMon
|
|
{
|
|
[DllImport("user32.dll")]
|
|
static extern bool MoveWindow(IntPtr Handle, int x, int y, int w, int h, bool repaint);
|
|
private bool Chanded = true;
|
|
public OffMon() {
|
|
|
|
}
|
|
|
|
public override void Set()
|
|
{
|
|
Chanded = true;
|
|
SConnector.FormMain.WindowState = SConnector.WindowState;
|
|
SConnector.FormMain.Location = new System.Drawing.Point(SConnector.x, SConnector.y);
|
|
SConnector.FormMain.Width = SConnector.Width;
|
|
SConnector.FormMain.Height = SConnector.Height;
|
|
Chanded = false;
|
|
}
|
|
public override void Resize(Process Proc, Control View)
|
|
{
|
|
if (Chanded) return;
|
|
Chanded = true;
|
|
if (SConnector.FormMain.WindowState == FormWindowState.Normal)
|
|
{
|
|
SConnector.Width = SConnector.FormMain.Width;
|
|
SConnector.Height = SConnector.FormMain.Height;
|
|
SConnector.x = SConnector.FormMain.Location.X;
|
|
SConnector.y = SConnector.FormMain.Location.Y;
|
|
}
|
|
SConnector.WindowState = SConnector.FormMain.WindowState;
|
|
Chanded = false;
|
|
}
|
|
public override IModeMon Change(IModeMon Mode)
|
|
{
|
|
return this;
|
|
}
|
|
|
|
}
|
|
}
|