AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DualHead move current window to the other desktop

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
latinsud



Joined: 30 Apr 2008
Posts: 1

PostPosted: Wed Apr 30, 2008 8:24 pm    Post subject: DualHead move current window to the other desktop Reply with quote

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
}
Back to top
View user's profile Send private message
frre
Guest





PostPosted: Wed Apr 30, 2008 9:49 pm    Post subject: Reply with quote

Aye lock bah! Laughing Hello there.

____________________________
Aye lock bah, aye lock bah, aye lock bah. Laughing
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group