/// <summary> /// Reset the mouse cursor area /// </summary> public static void ResetMouseCursorClipRect() { NativeRect rect = new NativeRect(0, 0, Screen.PrimaryScreen.Bounds.Right, Screen.PrimaryScreen.Bounds.Bottom); if (!User32.ClipCursor(ref rect)) throw new ArgumentException("Cannot work with rect!"); }
public static extern bool GetClipCursor(out NativeRect lpRect);
public static void SetThumbnailClip(IntPtr hwnd, NativeRect? rect) { if (IsInitialized) { if (rect.HasValue) { IntPtr rectPtr = Marshal.AllocCoTaskMem(Marshal.SizeOf(rect)); try { Marshal.StructureToPtr(rect, rectPtr, true); taskbar.SetThumbnailClip(hwnd, rectPtr); } finally { Marshal.FreeCoTaskMem(rectPtr); } } else taskbar.SetThumbnailClip(hwnd, IntPtr.Zero); } }
public static extern bool ClipCursor(ref NativeRect lpRect);