Esempio n. 1
0
 private void globalMouse_MouseMove(object sender, WindowsHookLib.MouseEventArgs e)
 {
     if (this.refForm.Handle != ((sender != null) ? ((IntPtr)sender) : intPtr) && this.refForm.toolStrip1.Handle != ((sender != null) ? ((IntPtr)sender) : intPtr))
     {
         if (((sender != null) ? ((IntPtr)sender) : intPtr) != IntPtr.Zero && this._object != ((sender != null) ? ((IntPtr)sender) : intPtr))
         {
             this._object = ((sender != null) ? ((IntPtr)sender) : intPtr);
             rect         = default(SCapture.Rect);
             if (SCapture.UnsafeNativeMethods.GetWindowRect(this._object, ref rect))
             {
                 this._objectRect = rect.ToRectangle();
             }
             else
             {
                 this._objectRect = default(Rectangle);
             }
         }
     }
     else
     {
         refForm.Focus();
         this._object = IntPtr.Zero;
     }
     this.Invalidate();
 }
 public static extern bool GetWindowRect(IntPtr hWnd, ref SCapture.Rect lpRect);