Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #If MouseIsOverTitlebar()
- XButton1::
- IfWinNotActive, ahk_class mpv
- Send {t}
- ControlSend,, {t}, ahk_class mpv
- return
- MouseIsOverTitlebar() {
- static WM_NCHITTEST := 0x84, HTCAPTION := 2
- CoordMode Mouse, Screen
- MouseGetPos x, y, w
- if WinExist("ahk_class Shell_TrayWnd ahk_id " w) ; Exclude taskbar.
- return false
- SendMessage WM_NCHITTEST,, x | (y << 16),, ahk_id %w%
- WinExist("ahk_id " w) ; Set Last Found Window for convenience.
- return ErrorLevel = HTCAPTION
- }
Advertisement
Add Comment
Please, Sign In to add comment