Jump to content

Why _MouseTrap wan't work correctly for me?


Recommended Posts

 
#include <GUIConstantsEx.au3>
#include <Misc.au3>
HotKeySet("+!d", "ShowMessage") ;Shift-Alt-d
;_Main()
$on = False
Local $GUI, $coords[4]


While 1
$coords = WinGetPos(WinGetTitle("", ""))
If($on) Then
  _MouseTrap($coords[0] + 50, $coords[1]+50, $coords[0] + $coords[2]-50, $coords[1] + $coords[3]-50)
Else
_MouseTrap()
EndIf
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
ExitLoop
Case Else
;;;
EndSwitch
WEnd
_MouseTrap()
Exit
Func ShowMessage()
    If($on) Then
$on = False
Else
$on = True
EndIf
EndFunc   ;==>ShowMessage

For some reason(2 monitors) I need to trap mouse in smaller rectangle, NOT in entire window, but + and -50 not affect on it.

Please, help.

 

EDIT: Even _MouseTrap(50, 50, 100, 100) doesn't work - it's traps ONLY to full size of active window.

Edited by GodlessSinner

_____________________________________________________________________________

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...