#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.