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