C#使用Windows API实现桌面上的遮罩层(鼠标穿透) C#实现实现桌面上的遮罩层(鼠标穿透)主要通过一下几个API函数来实现:GetWindowLong,SetWindowLong,SetLayeredWindowAttributes.其中有一个Windows 消息 WS_EX_TRANSPARENT 比较重要,它实现了鼠标穿透的功能. 下面来看看完整的实现代码: using System; using System.Drawing; using System.Windows.Forms…
private void Window_MouseMove(object sender, MouseEventArgs e){ NavBtnList.Clear(); Point mouseP = e.GetPosition(this); VisualTreeHelper.HitTest(this, new HitTestFilterCallback(HitFilter), new HitTestResultCallback(HitResult), new PointHitTest…
GameViewportClient中有个变量控制是否显示硬件鼠标: var transient bool bDisplayHardwareMouseCursor 也就是系统的光标,一般通过该类中的函数来操纵: simulated event SetHardwareMouseCursorVisibility(bool bIsVisible) { local Vector2D ViewportSize; //If we are going to be turning on the hardware…