aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Engine/WindowManager/ShiftWindow.cs
diff options
context:
space:
mode:
authorIBMPCDOS5 <[email protected]>2017-09-24 15:10:21 -0500
committerGitHub <[email protected]>2017-09-24 15:10:21 -0500
commit554a97739a89345613e5ca6fcdb9022ef80e665e (patch)
tree035533bf35faa4c1480adc8ef033fd8d9c65c8c5 /ShiftOS.Engine/WindowManager/ShiftWindow.cs
parent061ce54709db3157ae3366607420639d34942c7e (diff)
parent0a552e395477d2bb4c90e12624d11b28545a4933 (diff)
downloadshiftos-rewind-554a97739a89345613e5ca6fcdb9022ef80e665e.tar.gz
shiftos-rewind-554a97739a89345613e5ca6fcdb9022ef80e665e.tar.bz2
shiftos-rewind-554a97739a89345613e5ca6fcdb9022ef80e665e.zip
Merge pull request #5 from AShifter/master
Update WM
Diffstat (limited to 'ShiftOS.Engine/WindowManager/ShiftWindow.cs')
-rw-r--r--ShiftOS.Engine/WindowManager/ShiftWindow.cs24
1 files changed, 24 insertions, 0 deletions
diff --git a/ShiftOS.Engine/WindowManager/ShiftWindow.cs b/ShiftOS.Engine/WindowManager/ShiftWindow.cs
index 6f9c90d..9caaa6c 100644
--- a/ShiftOS.Engine/WindowManager/ShiftWindow.cs
+++ b/ShiftOS.Engine/WindowManager/ShiftWindow.cs
@@ -7,6 +7,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
+using System.Runtime.InteropServices;
namespace ShiftOS.Engine.WindowManager
{
@@ -16,5 +17,28 @@ namespace ShiftOS.Engine.WindowManager
{
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();
+ }
+
}
}