Пример #1
0
 private void MouseHook_MouseUp(object sender, WindowsHookLib.MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         e.Handled = (((sender != null) ? ((IntPtr)sender) : intPtr) != this.refForm.toolStrip1.Handle && ((sender != null) ? ((IntPtr)sender) : intPtr) != this.refForm.Handle);
     }
 }
Пример #2
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();
 }
Пример #3
0
 private void MouseMove(object sender, WindowsHookLib.MouseEventArgs e)
 {
     if (pressingPrintAreaBtns())
     {
         Point currentMousePos = e.Location;
         printSelection.Select(new Rectangle(mouseStartPos, currentMousePos));
     }
 }
Пример #4
0
 private void MouseDown(object sender, WindowsHookLib.MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         pressingLMouseBtn = true;
         if (pressingPrintAreaBtns())
         {
             // start screen selection
             mouseStartPos  = e.Location;
             printSelection = new PrintAreaSelection(mouseStartPos);
         }
     }
 }
Пример #5
0
 private void MouseUp(object sender, WindowsHookLib.MouseEventArgs e)
 {
     if (e.Button == MouseButtons.Left)
     {
         if (pressingPrintAreaBtns())
         {
             // stop screen selection
             printSelection.Deselect();
             mouseStopPos = e.Location;
             PrintScreen(mouseStartPos, mouseStopPos);
         }
         pressingLMouseBtn = false;
     }
 }