Guest User

Untitled

a guest
Nov 12th, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #NoEnv
  2. #Persistent
  3. SetTitleMatchMode, 2
  4.  
  5. SetTimer, tableDiff, 10
  6.  
  7. firstRun := 0
  8. CoordMode, Mouse, Screen
  9. return
  10.  
  11. tableDiff:
  12. if (firstRun <> 0)
  13.     {
  14.     winUnderMouseLast := winUnderMouseCurrent
  15.     WinActivate, %winUnderMouseLast%
  16.     WinGetTitle, titleLast, ahk_id %winUnderMouseLast%
  17.     WinGetClass, classLast, ahk_id %winUnderMouseLast%
  18.     WinGetPos, xLast, yLast, wLast, hLast, ahk_id %winUnderMouseLast%
  19.     }
  20. else
  21. msgbox, 1st run
  22.  
  23.  
  24. MouseGetPos,,,winUnderMouseCurrent
  25. WinActivate, %winUnderMouseCurrent%
  26. WinGetTitle, titleCurrent, ahk_id %winUnderMouseCurrent%
  27. WinGetClass, classCurrent, ahk_id %winUnderMouseCurrent%
  28. WinGetPos, xCurrent, yCurrent, wCurrent, hCurrent, ahk_id %winUnderMouseCurrent%
  29.  
  30. If (winUnderMouseLast != winUnderMouseCurrent)
  31.  {
  32.     winMove, %titleLast%,,%xLast%,%yLast%
  33.    
  34.     ;msgbox, Current %titleCurrent%  Last %titleLast%
  35.     WinMove, %titleCurrent%,, 421, 156, 1016, 727
  36.     ;msgbox, %titleLast%,%xLast%,%yLast%
  37.  }
  38.  
  39. firstRun := 1
  40. return
Advertisement
Add Comment
Please, Sign In to add comment