2017-09-24 18:32:50 +00:00
|
|
|
|
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;
|
2017-09-24 19:56:11 +00:00
|
|
|
|
using System.Runtime.InteropServices;
|
2017-09-24 18:32:50 +00:00
|
|
|
|
|
|
|
|
|
namespace ShiftOS.Engine.WindowManager
|
|
|
|
|
{
|
|
|
|
|
public partial class ShiftWindow : Form
|
|
|
|
|
{
|
|
|
|
|
public ShiftWindow()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
2017-09-24 19:56:11 +00: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();
|
|
|
|
|
|
|
|
|
|
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();
|
|
|
|
|
}
|
|
|
|
|
|
2017-09-24 18:32:50 +00:00
|
|
|
|
}
|
|
|
|
|
}
|