20
10
When working with two (or more screens), a common problem is that launched applications appear on the "wrong" screen. I especially find this annoying when launching a text editor from the command line, because I have to leave the home row with my right hand in order to drag the window to the "right" screen before I can continue typing.
Is it possible to define a keyboard shortcut which moves the current application to the other/next screen?
Edit: I'm using Windows XP, but it's good to know that the feature already exists in Windows 7.
Edit2: I went for the autohotkey script. This adaptation works for me:
#q::
WinGetPos, winx, winy,,, A
WinGet, mm, MinMax, A
WinRestore, A
If (winx > 1270)
{
newx := winx-1270
OutputDebug, Moving left from %winx% to %newx%
}
else
{
newx := winx+1270
OutputDebug, Moving right from %winx% to %newx%
}
WinMove, A,, newx, winy
if mm=1
WinMaximize, A
Return
I did have to make use of the OutputDebug statements and dbgview to discover the proper threshold value 1270
for moving left or right. The exact threshold is especially important when moving maximized windows to the left.
1This is promising, but the loop is really slow. The window crawled over my desktop at a snail's pace :-) – wcoenen – 2009-10-29T15:59:03.670
The script also moves the window under the mouse pointer, instead of the currently active one. – wcoenen – 2009-10-29T16:03:05.690
Whoops! I have it on mouse 4 and double click, so under mouse is better for me, and the crawling thing is because XP was slow at redrawing windows. It's fine on Vista and above. One moment, please :) – Phoshi – 2009-10-29T16:11:27.077
Right, edited the script there, try that :) – Phoshi – 2009-10-29T16:14:22.220