;MoveToMon ;By jgpaiva ;date: February 2007 ;Function: Move window to the other screen ScriptName = MoveToMon ScriptVersion = 1.0 Sysget,MonitorCount,MonitorCount If (MonitorCount <> 2) { msgbox, you need 2 monitors to run this program! exitapp } Sysget,Monitor1,Monitor,1 Sysget,Monitor2,Monitor,2 Monitor1Height := Monitor1Bottom - Monitor1Top Monitor1Width := Monitor1Right - Monitor1Left Monitor2Height := Monitor2Bottom - Monitor2Top Monitor2Width := Monitor2Right - Monitor2Left Menu,Tray,Add,MoveWindow,MoveWindow Menu,Tray,Default,MoveWindow Menu,Tray,NoStandard return #z:: Movewindow: WinGetPos,X,Y,Width,Height,A If (x >= Monitor1Left AND x <= Monitor1Right AND y>=Monitor1Top AND y <= Monitor1Bottom) { ;;window in monitor 1 WinX := X + (Monitor2Left - Monitor1Left) WinY := Y + (Monitor2Top - Monitor1Top) WinWidth := Width * (Monitor2Width / Monitor1Width) WinHeight := Height * (Monitor2Height / Monitor1Height) WinGet,MinMax,MinMax,A If Minmax = 1 Maximized := true WinRestore,A WinMove,A,,WinX,WinY,WinWidth,WinHeight If Maximized WinMaximize,A } else { ;;window on monitor 2 WinX := X + (Monitor1Left - Monitor2Left) WinY := Y + (Monitor1Top - Monitor2Top) WinWidth := Width * (Monitor1Width / Monitor2Width) WinHeight := Height * (Monitor1Height / Monitor2Height) WinGet,MinMax,MinMax,A If Minmax = 1 Maximized := true WinRestore,A WinMove,A,,WinX,WinY,WinWidth,WinHeight If Maximized WinMaximize,A } return