我很接近,但我无法让我的触发器工作。我希望能够在拖动时通过右键单击将当前正在拖动(活动)的窗口捕捉到屏幕的四分之一。它应该捕捉到我的鼠标当前所在屏幕的四分之一。触发器是我觉得我缺少的东西:当我释放鼠标右键时,将活动窗口移动到相对于鼠标所在位置的尺寸。建议?
~Lbutton & ~Rbutton::
CoordMode,Mouse,Screen ;mouse position relative to the screen
MouseGetPos,Xpos,Ypos ;get mouse position coordinates
;WinGet, active_id, ID, A
;msgbox %Xpos%,%Ypos% ;show the saved mouse coordinates
RIGHT_height=537
RIGHT_width=848
RIGHT_leftpos=1680
RIGHT_rightpos=2523
RIGHT_toppos=-70
RIGHT_vp=460
LEFT_height=518
LEFT_width=847
LEFT_leftpos=-8
LEFT_rightpos=834
LEFT_toppos=-10
LEFT_vp=503
;LEFT SCREEN
if (Xpos < LEFT_rightpos and ypos < LEFT_vp) { ;LEFT top left
WinMove,Untitled - Notepad,,%LEFT_leftpos%,%LEFT_toppos%,%LEFT_width%,%LEFT_height%
}
if (Xpos > LEFT_rightpos and Xpos < 1680 and ypos < LEFT_vp) { ;LEFT top right
MsgBox LEFT top right
}
if (Xpos < LEFT_rightpos and Xpos < 1680 and ypos > LEFT_vp) { ;LEFT top right
msgbox LEFT Bottom Left
}
if (Xpos > LEFT_rightpos and Xpos < 1680 and ypos > LEFT_vp) { ;LEFT top right
msgbox LEFT Bottom Right
}
;RIGHT SCREEN
if (Xpos < RIGHT_rightpos and Xpos >= 1680 and ypos < RIGHT_vp) { ;RIGHT top left
msgbox RIGHT Top Left
}
if (Xpos > RIGHT_rightpos and Xpos >= 1680 and ypos < RIGHT_vp) { ;RIGHT top right
msgbox RIGHT Top Right
}
if (Xpos < RIGHT_rightpos and Xpos >= 1680 and ypos > RIGHT_vp) { ;RIGHT top right
msgbox RIGHT Bottom Left
}
if (Xpos > RIGHT_rightpos and Xpos >= 1680 and ypos > RIGHT_vp) { ;RIGHT top right
msgbox RIGHT Bottom Right
}
return