latinsud
Joined: 30 Apr 2008 Posts: 1
|
Posted: Wed Apr 30, 2008 8:24 pm Post subject: DualHead move current window to the other desktop |
|
|
This is a small script to swap desktop of active window, that is, to move it to the other screen (by moving it horizontally).
It takes care of maximized windows, restoring them before moving them.
| Code: | #Backspace::
{
ventana := WinExist("A")
WinGetPos, posX
WinGet, Max, MinMax
; If window was maximized restore first
if ( Max == 1 ) {
WinRestore
}
WinGetPos, posX,,tamX
centroX := posX + tamX/2
; Find out what side to shift to
if ( Max == 0 || Max == 1 ) {
if ( centroX < A_ScreenWidth ) {
WinMove, % posX + A_ScreenWidth
} else {
WinMove, % posX - A_ScreenWidth
}
}
; Maximize if required
if ( Max == 1 ) {
WinMaximize
}
return
}
|
|
|