2017-03-17 19:31:41 -04:00
|
|
|
|
using System;
|
2017-03-26 13:28:05 -04:00
|
|
|
|
using System.Runtime.InteropServices;
|
2017-03-17 19:31:41 -04:00
|
|
|
|
using System.Windows.Forms;
|
|
|
|
|
|
2017-03-31 18:31:16 -04:00
|
|
|
|
namespace TimeHACK.Engine.Template
|
2017-03-17 19:31:41 -04:00
|
|
|
|
{
|
|
|
|
|
public partial class WinClassic : Form
|
|
|
|
|
{
|
|
|
|
|
public WinClassic()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
2017-03-26 13:28:05 -04:00
|
|
|
|
|
2017-03-27 10:53:12 -04:00
|
|
|
|
public System.Drawing.Font fnt;
|
|
|
|
|
|
2017-03-27 20:48:31 -04:00
|
|
|
|
public bool closeDisabled = false;
|
|
|
|
|
|
2017-03-26 13:28:05 -04:00
|
|
|
|
public const int WM_NCLBUTTONDOWN = 0xA1;
|
|
|
|
|
public const int HT_CAPTION = 0x2;
|
|
|
|
|
|
|
|
|
|
[DllImportAttribute("user32.dll")]
|
|
|
|
|
public static extern int SendMessage(IntPtr hWnd,
|
|
|
|
|
int Msg, int wParam, int lParam);
|
|
|
|
|
[DllImportAttribute("user32.dll")]
|
|
|
|
|
public static extern bool ReleaseCapture();
|
|
|
|
|
|
2017-03-26 17:16:44 -04:00
|
|
|
|
private void Programtopbar_drag(object sender, MouseEventArgs e)
|
2017-03-26 13:28:05 -04:00
|
|
|
|
{
|
|
|
|
|
if (e.Button == MouseButtons.Left)
|
|
|
|
|
{
|
|
|
|
|
ReleaseCapture();
|
|
|
|
|
SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void closebutton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2017-03-27 20:48:31 -04:00
|
|
|
|
if (!closeDisabled) this.Close();
|
2017-03-26 13:28:05 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public Boolean max = false;
|
|
|
|
|
|
|
|
|
|
private void maximizebutton_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
if (max == false)
|
|
|
|
|
{
|
|
|
|
|
this.right.Hide();
|
|
|
|
|
this.left.Hide();
|
|
|
|
|
this.bottom.Hide();
|
|
|
|
|
this.top.Hide();
|
|
|
|
|
this.bottomleftcorner.Hide();
|
|
|
|
|
this.bottomrightcorner.Hide();
|
|
|
|
|
this.topleftcorner.Hide();
|
|
|
|
|
this.toprightcorner.Hide();
|
|
|
|
|
this.Dock = DockStyle.Fill;
|
2017-03-27 14:38:53 -04:00
|
|
|
|
this.WindowState = FormWindowState.Maximized;
|
2017-03-26 13:28:05 -04:00
|
|
|
|
max = true;
|
2017-03-31 16:17:32 -04:00
|
|
|
|
maximizebutton.Image = Engine.Properties.Resources.WinClassicRestore;
|
2017-03-26 13:28:05 -04:00
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
this.right.Show();
|
|
|
|
|
this.left.Show();
|
|
|
|
|
this.bottom.Show();
|
|
|
|
|
this.top.Show();
|
|
|
|
|
this.bottomleftcorner.Show();
|
|
|
|
|
this.bottomrightcorner.Show();
|
|
|
|
|
this.topleftcorner.Show();
|
|
|
|
|
this.toprightcorner.Show();
|
|
|
|
|
this.Dock = DockStyle.None;
|
2017-03-27 14:38:53 -04:00
|
|
|
|
this.WindowState = FormWindowState.Normal;
|
2017-03-26 13:28:05 -04:00
|
|
|
|
max = false;
|
2017-03-31 16:17:32 -04:00
|
|
|
|
maximizebutton.Image = Engine.Properties.Resources.WinClassicMax;
|
2017-03-26 13:28:05 -04:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
2017-03-17 19:31:41 -04:00
|
|
|
|
}
|
|
|
|
|
}
|