Guest User

Untitled

a guest
Aug 18th, 2016
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. #If MouseIsOverTitlebar()
  2. XButton1::
  3. IfWinNotActive, ahk_class mpv
  4. Send {t}
  5. ControlSend,, {t}, ahk_class mpv
  6. return
  7.  
  8.  
  9. MouseIsOverTitlebar() {
  10. static WM_NCHITTEST := 0x84, HTCAPTION := 2
  11. CoordMode Mouse, Screen
  12. MouseGetPos x, y, w
  13. if WinExist("ahk_class Shell_TrayWnd ahk_id " w) ; Exclude taskbar.
  14. return false
  15. SendMessage WM_NCHITTEST,, x | (y << 16),, ahk_id %w%
  16. WinExist("ahk_id " w) ; Set Last Found Window for convenience.
  17. return ErrorLevel = HTCAPTION
  18. }
Advertisement
Add Comment
Please, Sign In to add comment