mirror of
https://github.com/ShiftOS-Rewind/ShiftOS.git
synced 2025-01-23 02:02:15 +00:00
0a552e3954
It's pretty much done. Pair with DE, and serve hot.
44 lines
1.1 KiB
C#
44 lines
1.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel;
|
|
using System.Drawing;
|
|
using System.Data;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows.Forms;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace ShiftOS.Engine.WindowManager
|
|
{
|
|
public partial class ShiftWindow : Form
|
|
{
|
|
public ShiftWindow()
|
|
{
|
|
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();
|
|
}
|
|
|
|
}
|
|
}
|