GodlessSinner Posted July 15, 2013 Share Posted July 15, 2013 (edited) #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 July 15, 2013 by GodlessSinner _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
DW1 Posted July 15, 2013 Share Posted July 15, 2013 Strange, I'm running Win7 x64 with three monitors and on all three this script is working as expected... AutoIt3 Online Help Link to comment Share on other sites More sharing options...
GodlessSinner Posted July 15, 2013 Author Share Posted July 15, 2013 It was my error, I forgot to close old exe. Sorry.. _____________________________________________________________________________ Link to comment Share on other sites More sharing options...
DW1 Posted July 15, 2013 Share Posted July 15, 2013 It was my error, I forgot to close old exe. Sorry.. No worries, I'm glad you got it working. Perhaps toss _Singleton() in to your script so that another user doesn't run in to the same issue. 0xdefea7 1 AutoIt3 Online Help Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now