您正在寻找MonitorWorkArea
,即MonitorWorkAreaLeft
您的屏幕截图的外观。
获取所有监视器信息的脚本:
SysGet, MonitorCount, MonitorCount
SysGet, MonitorPrimary, MonitorPrimary
Message .= "Monitor Count:`t" MonitorCount "`nPrimary Monitor:`t" MonitorPrimary
Loop, %MonitorCount%
{
SysGet, MonitorName, MonitorName, %A_Index%
SysGet, Monitor, Monitor, %A_Index%
SysGet, MonitorWorkArea, MonitorWorkArea, %A_Index%
Message .= "`n`nMonitor:`t#" A_Index "`nName:`t" MonitorName "`nLeft:`t" MonitorLeft "(" MonitorWorkAreaLeft " work)`nTop:`t" MonitorTop " (" MonitorWorkAreaTop " work)`nRight:`t" MonitorRight " (" MonitorWorkAreaRight " work)`nBottom:`t" MonitorBottom "(" MonitorWorkAreaBottom " work)"
}
msgbox % Message
找到您想要使用的正确监视器后,使用坐标值:
SysGet, MonitorWorkArea, MonitorWorkArea, 2
msgbox % MonitorWorkAreaLeft
编辑
这将在每次运行时获取值并移动窗口。
SysGet, MonitorWorkArea, MonitorWorkArea, 1 ; Leftmost monitor
X1 := MonitorWorkAreaLeft
Y1 := MonitorWorkAreaTop
SysGet, MonitorWorkArea, MonitorWorkArea, 2 ; Rightmost monitor
Width := MonitorWorkAreaRight - X1
Height := MonitorWorkAreaBottom
WinGetActiveTitle, Title
WinMove, % Title,, % X1, % Y1, % Width, % Height