C# 鼠标穿透窗体与恢复

转自原文 C# 鼠标穿透窗体与恢复

引入user32.dll

 [DllImport("user32.dll")]
 public static extern uint SetWindowLong(IntPtr h, int n, uint x);

 

使指定窗体穿透,this.Handle为将要设为穿透效果的窗体句柄

SetWindowLong(this.Handle, -20, 0x20 | 0x80000);

 

恢复

  this.FormBorderStyle =  this.FormBorderStyle;

 

posted @ 2017-01-10 20:32  wenglabs  阅读(772)  评论(0编辑  收藏  举报