62 lines
2.1 KiB
C#
62 lines
2.1 KiB
C#
using Remontor.Setting;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Diagnostics;
|
|
using System.Drawing;
|
|
using System.Linq;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
|
|
namespace Remontor.Connector
|
|
{
|
|
internal class DobleMonFull : IModeMon
|
|
{
|
|
[DllImport("user32.dll")]
|
|
static extern bool MoveWindow(IntPtr Handle, int x, int y, int w, int h, bool repaint);
|
|
|
|
private bool Chanded = false;
|
|
public int OldWidth, OldHeight;
|
|
public Point OldPoint;
|
|
public FormWindowState OldState;
|
|
public DobleMonFull()
|
|
{
|
|
OldWidth = SConnector.FormMain.Bounds.Width;
|
|
OldHeight = SConnector.FormMain.Height;
|
|
OldState = SConnector.FormMain.WindowState;
|
|
OldPoint = SConnector.FormMain.Location;
|
|
}
|
|
public override void Resize(Process Proc, Control View)
|
|
{
|
|
if (Chanded) return;
|
|
Chanded = true;
|
|
SConnector.FormMain.WindowState = FormWindowState.Normal;
|
|
Chanded = false;
|
|
SConnector.FormMain.Width = SGlobalSetting.settingApp.WidthDoble;
|
|
SConnector.FormMain.Height = SGlobalSetting.settingApp.HeightDoble;
|
|
SConnector.FormMain.Location = new System.Drawing.Point(SGlobalSetting.settingApp.xPosDoble, SGlobalSetting.settingApp.yPosDoble);
|
|
MoveWindow(Proc.MainWindowHandle, View.Bounds.X, View.Bounds.Y + 9, View.Bounds.Width, View.Bounds.Height - 9, true);
|
|
}
|
|
|
|
public override IModeMon Change(IModeMon Mode)
|
|
{
|
|
|
|
if (!(Mode is DobleMonFull))
|
|
{
|
|
Chanded = true;
|
|
SConnector.FormMain.WindowState = OldState;
|
|
SConnector.FormMain.Width = OldWidth;
|
|
SConnector.FormMain.Height = OldHeight;
|
|
SConnector.FormMain.Location = OldPoint;
|
|
Chanded = false;
|
|
}
|
|
else
|
|
{
|
|
return this;
|
|
}
|
|
return Mode;
|
|
}
|
|
}
|
|
}
|