C#无边框应用

 

引用using System.Runtime.InteropServices;

 

在窗体的全局模式下输入

[DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);

 

在窗体或者容器的MouseDown事件输入

ReleaseCapture();
SendMessage(this.Handle, 0x0112, 0xF010 + 0x0002, 0);//最简单用法

 

posted @ 2016-08-06 21:21  张瑞丰  阅读(344)  评论(0编辑  收藏  举报