无边框窗体移动:

//窗体移动API
[DllImport("user32.dll")]
public static extern bool ReleaseCapture();
[DllImport("user32.dll")]
public static extern bool SendMessage(IntPtr hwnd, int wMsg, int wParam, int IParam);
public const int WM_SYSCOMMAND = 0x0112;
public const int SC_MOVE = 0xF010;
public const int HTCAPTION = 0x0002;
[DllImport("user32")]
private static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, IntPtr lParam);
private const int WM_SETREDRAW = 0xB; private void Form1_MouseDown(object sender, MouseEventArgs e)
{
if (this.WindowState == FormWindowState.Normal)
{
ReleaseCapture();
SendMessage(this.Handle, WM_SYSCOMMAND, SC_MOVE + HTCAPTION, );
}
}

无边框窗体阴影:

     //窗体阴影API
const int CS_DropSHADOW = 0x20000;
const int GCL_STYLE = (-);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int SetClassLong(IntPtr hwnd, int nIndex, int dwNewLong);
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int GetClassLong(IntPtr hwnd, int nIndex); public Form1()
{
InitializeComponent();
SetClassLong(this.Handle, GCL_STYLE, GetClassLong(this.Handle, GCL_STYLE) | CS_DropSHADOW);
}

最新文章

  1. 把token带到 http头部 或者验证一下referer
  2. LINQ to SQL语句(9)之Top/Bottom和Paging和SqlMethods
  3. flask SQLAlchemy中一对多的关系实现
  4. 「2014-3-18」multi-pattern string match using aho-corasick
  5. iOS - 网络语线程(OC)
  6. PHPStorm 2016.2 - 2016.3许可证服务器
  7. 极光推送-Java后台实现方式一:Http API
  8. Bitset([HZOI 2015]偏序++)
  9. nodejs学习以及SSJS漏洞
  10. docker网络
  11. Linux中的libc和glibc
  12. 构造读写IRP(转)
  13. UNIX 家族及Linux
  14. hybrid app 知识点
  15. Python学习笔记:startswith & endswith 判断开头结尾是否为指定字符串
  16. [转]VC++获取文件大小集锦
  17. Eclipse Ctrl + Shift + O in IntelliJ IDEA
  18. JDK1.5中支持的 for循环的语法
  19. mutillidae2.6.48部署到phpstudy
  20. quartz 配置运行

热门文章

  1. Convert XML to Object using LINQ
  2. loj 1167(二分+最大流)
  3. javascript中时间的手动创建date的方式
  4. Element selector doesn't have required
  5. 汇编学习(五)——表处理程序
  6. Linux(centos)如何安装Zend Optimizer Zend Guard Loader
  7. pythonpython-eggs异常解决方法
  8. js渐隐渐入渐出效果 fadeOut fadeIn
  9. jQuery WipeTouch
  10. Hadoop学习笔记(2)