diff options
| author | AShifter <[email protected]> | 2017-09-24 13:56:11 -0600 |
|---|---|---|
| committer | AShifter <[email protected]> | 2017-09-24 13:56:11 -0600 |
| commit | 0a552e395477d2bb4c90e12624d11b28545a4933 (patch) | |
| tree | 035533bf35faa4c1480adc8ef033fd8d9c65c8c5 /ShiftOS.Engine/WindowManager/ShiftWindow.cs | |
| parent | 9107510c4985ceb781640163bbb82ab6de2fa35e (diff) | |
| download | shiftos-rewind-0a552e395477d2bb4c90e12624d11b28545a4933.tar.gz shiftos-rewind-0a552e395477d2bb4c90e12624d11b28545a4933.tar.bz2 shiftos-rewind-0a552e395477d2bb4c90e12624d11b28545a4933.zip | |
Update WM
It's pretty much done. Pair with DE, and serve hot.
Diffstat (limited to 'ShiftOS.Engine/WindowManager/ShiftWindow.cs')
| -rw-r--r-- | ShiftOS.Engine/WindowManager/ShiftWindow.cs | 24 |
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(); + } + } } |
