21

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.

4 Answers 4

4

Autohotkey! This'll move between the monitors (two 1680x1050 monitors, set the value after Loop, to be each monitor's screen resolution/10 if you're different) on winkey (#) and q. Control is ^, alt is !, shift is +, and letters are letters. You can use combinations of the modifiers, too.

#z:: ;Move the active window to the other monitor.
WinGetPos, winx, winy,,, A
WinGet, oldWin,ID,A
WinActivate, A
WinGet, mm, MinMax, A
WinRestore, A
If winx+5 >= 0 then
    mult=1
else
    mult=-1
WinMove,A,, winx-(1680*mult), winy
if mm=1
    WinMaximize, A
Return
4
  • 1
    This is promising, but the loop is really slow. The window crawled over my desktop at a snail's pace :-)
    – wcoenen
    Oct 29, 2009 at 15:59
  • The script also moves the window under the mouse pointer, instead of the currently active one.
    – wcoenen
    Oct 29, 2009 at 16:03
  • 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
    Oct 29, 2009 at 16:11
  • Right, edited the script there, try that :)
    – Phoshi
    Oct 29, 2009 at 16:14
58

What version of Windows are you using? Windows 7 comes with native support for exactly this.

Win+Shift+left: Move focussed window one monitor to the left

Win+Shift+right: Move focussed window one monitor to the right

EDIT: For XP you could try out UltraMon. Amongst other things it will allow you to define hotkeys for "Move window to next monitor" and "Move window to previous Monitor".

7
  • 1
    I feel like a newb for not knowing that +1
    – Ivo Flipse
    Oct 29, 2009 at 15:30
  • Off topic, but how did you make those "buttons"?
    – sYnfo
    Oct 29, 2009 at 15:30
  • 2
    @sYnfo wrap the "button" in a <kbd></kbd> tag
    – BenA
    Oct 29, 2009 at 15:32
  • +1, thanks for that. I was using Ultramon previously, no longer need it with this.
    – Pauk
    Oct 29, 2009 at 15:34
  • 2
    THIS should have been picked as the answer. Glad I found this.
    – Bless Yahu
    Jul 16, 2012 at 18:30
3

in other versions of windows, you can right click on the taskbar, select "move" and then use the arrow keys to move the window across to the correct window... I only mention this because every now and then, I accidentally leave a window on the wrong monitor and then when I use my laptop at home, I can't see the window because it's off monitor. Took me a while to figure this out!

2
  • 1
    Though under Windows7 You cannot move from the taskbar menu, You still can move the windows using shortcut keys: Ctrl+Space and then M, arrow keys, finally Enter. en.wikipedia.org/wiki/… Jul 7, 2013 at 17:50
  • Correction: In Windows 7, you can move from the taskbar - Use Shift + Right Click
    – Amit Naidu
    Nov 11, 2017 at 22:09
1

If you don't have Windows 7, you may want to try DisplayFusion. The free version allows you to configure hotkeys to move windows to the next monitor, and several other goodies.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .