111,125
社区成员
发帖
与我相关
我的任务
分享using System;
using System.Windows.Forms;
using System.Runtime.InteropServices;
namespace WindowsApplication9
{
public partial class Form1 : Form
{
[DllImport("user32.dll", EntryPoint = "SendMessage")]
public static extern int SendMessage(int hWnd, int wMsg, int wParam, int lParam);
[DllImport("user32.dll", EntryPoint = "ReleaseCapture")]
public static extern int ReleaseCapture();
public const int WM_SysCommand = 0x0112;
public const int SC_MOVE = 0xF012;
public Form1()
{
InitializeComponent();
}
private void Flash_MouseDown(object sender, MouseEventArgs e)
{
ReleaseCapture();
SendMessage(this.Handle.ToInt32(), WM_SysCommand, SC_MOVE, 0);
}
}
}