c#winform窗体鼠标穿透,做桌面小工具的来看看啦
private const uint WS_EX_LAYERED = 0x80000;
private const int WS_EX_TRANSPARENT = 0x20;
private const int GWL_STYLE = (-16);
private const int GWL_EXSTYLE = (-20);
private const int LWA_ALPHA = 0;
[DllImport("user32", EntryPoint = "SetWindowLong")]
private static extern uint SetWindowLong(
IntPtr hwnd,
int nIndex,
uint dwNewLong
);
[DllImport("user32", EntryPoint = "GetWindowLong")]
private static extern uint GetWindowLong(
IntPtr hwnd,
int nIndex
);
[DllImport("user32", EntryPoint = "SetLayeredWindowAttributes")]
private static extern int SetLayeredWindowAttributes(
IntPtr hwnd,
int crKey,
int bAlpha,
int dwFlags
);
/// <summary>
/// 设置窗体具有鼠标穿透效果
/// </summary>
public void SetPenetrate()
{
this.TopMost = true;
GetWindowLong(this.Handle, GWL_EXSTYLE);
SetWindowLong(this.Handle, GWL_EXSTYLE, WS_EX_TRANSPARENT | WS_EX_LAYERED);
SetLayeredWindowAttributes(this.Handle, 0, 100, LWA_ALPHA);
} 可能有很多淫分享过。。。但还是忍不住来分享
...全文
相关推荐
基于C#WinForm的鼠标穿透窗体源码.zip
基于C#WinForm的鼠标穿透窗体源码.zip
鼠标穿透窗体.zip源码C#WinForm实例源码适合研究学习技术
鼠标穿透窗体.zip源码C#WinForm实例源码适合研究学习技术鼠标穿透窗体.zip源码C#WinForm实例源码适合研究学习技术 1.适合学生做毕业设计参考模板。 2.适合程序员学习开发研究用 3.适合小公司做项目参考技术使用用
C#Winform窗体美化界面.rar
采用GDI+对Winform窗体美化:无边框窗体、窗体圆角、系统按钮控制器 等
鼠标穿透.zip源码C#WinForm实例源码适合研究学习技术
鼠标穿透.zip源码C#WinForm实例源码适合研究学习技术鼠标穿透.zip源码C#WinForm实例源码适合研究学习技术 1.适合学生做毕业设计参考模板。 2.适合程序员学习开发研究用 3.适合小公司做项目参考技术使用用
C#WinForm窗体皮肤大全
利用第三方控件实现C#中WinForm窗体皮肤,蛮齐全的,大家可以自己下载试试看!



