示例#1
0
 /// <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!");
 }
示例#2
0
 public static extern bool GetClipCursor(out NativeRect lpRect);
示例#3
0
 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);
     }
 }
示例#4
0
 public static extern bool ClipCursor(ref NativeRect lpRect);