aboutsummaryrefslogtreecommitdiff
path: root/TimeHACK.Engine/Template/WinClassic.cs
diff options
context:
space:
mode:
authorAShifter <[email protected]>2017-03-26 11:28:05 -0600
committerAShifter <[email protected]>2017-03-26 11:28:24 -0600
commitf16f3a8a3df33f46c4ec6c864447cced97c0f034 (patch)
tree6c06d045bd7afa16c89b63c01c41b2ace019ff8b /TimeHACK.Engine/Template/WinClassic.cs
parenta7128e18c33b39b6253f9af3022fb1a47b1ac5f1 (diff)
downloadhistacom2-f16f3a8a3df33f46c4ec6c864447cced97c0f034.tar.gz
histacom2-f16f3a8a3df33f46c4ec6c864447cced97c0f034.tar.bz2
histacom2-f16f3a8a3df33f46c4ec6c864447cced97c0f034.zip
Finished WindowManager.cs
I HOPE YOU LIKE IT HONEYFRY
Diffstat (limited to 'TimeHACK.Engine/Template/WinClassic.cs')
-rw-r--r--TimeHACK.Engine/Template/WinClassic.cs66
1 files changed, 59 insertions, 7 deletions
diff --git a/TimeHACK.Engine/Template/WinClassic.cs b/TimeHACK.Engine/Template/WinClassic.cs
index aa72263..1bd11e3 100644
--- a/TimeHACK.Engine/Template/WinClassic.cs
+++ b/TimeHACK.Engine/Template/WinClassic.cs
@@ -1,11 +1,5 @@
using System;
-using System.Collections.Generic;
-using System.ComponentModel;
-using System.Data;
-using System.Drawing;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
+using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace TimeHACK.Engine.Template
@@ -16,5 +10,63 @@ namespace TimeHACK.Engine.Template
{
InitializeComponent();
}
+
+ 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();
+
+ private void programtopbar_drag(object sender, MouseEventArgs e)
+ {
+ if (e.Button == MouseButtons.Left)
+ {
+ ReleaseCapture();
+ SendMessage(Handle, WM_NCLBUTTONDOWN, HT_CAPTION, 0);
+ }
+ }
+
+ private void closebutton_Click(object sender, EventArgs e)
+ {
+ this.Close();
+ }
+
+ 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;
+ max = true;
+ maximizebutton.Image = Properties.Resources.WinClassicRestore;
+ }
+ 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;
+ max = false;
+ maximizebutton.Image = Properties.Resources.WinClassicMax;
+ }
+
+ }
}
}