3

I have a multiscreen computer:

enter image description here

and I use WindowPad to move (arrange) any window on the screen, and this program is too capable of moving them between monitors by pressing WinKey+Enter.

The issue is: the moved window is re-scaled (resized) to the corresponding size of the new monitor, as you can see in the two images below. From a 1280x1024 screen:

enter image description here

to a 1920x1200 screen:

enter image description here

Note the resized Putty SSH console window. That is not what I want.

Moving windows without using the mouse is extremely useful for me, but I have not been capable to find a practical way to do this without resizing that window.
The pop-up menu that most windows have is not valid, because, even when I can move the windows, this moving is too slow (I prefer to use the mouse in that case):

enter image description here

WinKey+Shift+arrow do not work on my Windows 7 SP1, I don´t know why.

Ideas are welcome.

  • Without rescaling, how would a maximized window on screen 1 fit when you move it to screen 6, or do you want the window to span multiple monitors? – Tymric Sep 29 '14 at 18:32
  • 1
    You are right, @Timmy, I did not think about it. Fortunately, I have found the solution: I have modified WindowPad source code successfully, and now it moves any window without rescaling it; and maximized windows keep maximized between monitors. I am researching to know if my solution should be published here at SuperUser, or at any other forum like StackOverFlow (as long as it is a programming response). Just give me a few days and I will post here my method. – Sopalajo de Arrierez Sep 29 '14 at 21:11
  • Timmy, I have added my answer here. It is based on the source modification. I will add precompiled .exe to AutoHotKey forums repositories as long as I will know how to do it. I suppose SuperUser has no storage for files, so I can't think about another way. – Sopalajo de Arrierez Sep 30 '14 at 15:50
  • Nice work! I think leaving a code here is fine, as long asn there are clear instructions on how to execute it. You could also store it at Github – Tymric Sep 30 '14 at 15:56
3

You don't need special software

Win+Shift+Left arrow: Move window to the monitor on the left
Win+Shift+Right arrow: Move window to the monitor on the right

Also, Windows-P opens the display switcher:

enter image description here

Computer only is the default option–and the name says it all.
Duplicate clones your screen to a connected secondary display, monitor or projector.
Extend expands the desktop so you can make room for extra windows.
Projector only turns off your laptop's LCD and turns the projector into your monitor

  • Win+Shift+Left/Right arrow are not working on my computer. And Windows+P is not valid, since I have 6 screens. Added info to original post. – Sopalajo de Arrierez Sep 28 '14 at 20:59
2

I have modified the original WindowPad source code to not resize windows when moving or changing monitor.

These are the steps:

  • Download from the link above and unzip.

  • To disable resizing of windows when moving edit \source\WindowPad.ahk to change (Windows Notepad is OK):

    ; Move and resize.
    WinMove,,, newx, newy, neww, newh
    

to (note the comments with ; character) :

        ; Move and resize.
;        WinMove,,, newx, newy, neww, newh
        WinMove,,, newx, newy, w, h

and change:

wp_CalcNewSizeAndPosition:
    ; Calculate desired size.
    neww := restore_w != "" ? restore_w : Round(monWidth * widthFactor)
    newh := restore_h != "" ? restore_h : Round(monHeight * heightFactor)

to (we keep some lines by using comments too) :

wp_CalcNewSizeAndPosition:
    ; Calculate desired size.
;    neww := restore_w != "" ? restore_w : Round(monWidth * widthFactor)
;    newh := restore_h != "" ? restore_h : Round(monHeight * heightFactor)
    neww := w
    newh := h
  • To disable resizing of windows when changing screen edit \source\WindowPad.ahk to change:

; Calculate new size. if (wp_IsResizable()) { w := Round(w*(mdw/msw)) h := Round(h*(mdh/msh)) }

to:

    ; Calculate new size.
    if (wp_IsResizable()) {
;        w := Round(w*(mdw/msw))
;        h := Round(h*(mdh/msh))
        w := w
        h := h
    }

(a rather ridiculous change this one, but it helps understanding the modification's sense)

  • Now you have your .ahk file that you can run if you have installed AutoHotKey. Or compile it to .exe by using the same program (Convert .ahk to .exe).

  • And a minor enhancement: These lines here are preventing to put your own icon in the tray (you can choose it when compiling the .ahk file, but it will not appear there):

.

if A_IsCompiled  ; Load icons from my custom WindowPad.exe.
{
; Default icon is 32x32, so doesn't look good in the tray.
Menu, Tray, Icon, %A_ScriptFullPath%, 2
}
else if (A_LineFile = A_ScriptFullPath)
{   ; Set the tray icon, but only if not included in some other script.
wp_SetTrayIcon(true)
; Use OnMessage to catch "Suspend Hotkeys" or "Pause Script"
; so the "disabled" icon can be used.
OnMessage(0x111, "WM_COMMAND")
}

so just comment them all:

;    if A_IsCompiled  ; Load icons from my custom WindowPad.exe.
;    {
;        ; Default icon is 32x32, so doesn't look good in the tray.
;        Menu, Tray, Icon, %A_ScriptFullPath%, 2
;    }
;    else if (A_LineFile = A_ScriptFullPath)
;    {   ; Set the tray icon, but only if not included in some other script.
;        wp_SetTrayIcon(true)
;        ; Use OnMessage to catch "Suspend Hotkeys" or "Pause Script"
;        ; so the "disabled" icon can be used.
;        OnMessage(0x111, "WM_COMMAND")
;    }

and now you can compile your .ahk to a .exe that will have your preferred icon for the file and for the tray icon (every AutoHotKey icon in the tray has the same green H if not specified).

My compilation to .exe is working fantastic. Now WindowPad is the best program I have ever seen to move and arrange windows, even with multiple screens.

Please reports bugs if you find them.

1

You can also use UltraMon (non-free, Windows, GUI) to set up a keyboard shortcut to move a window to the next or previous monitor.

enter image description here

As Jan said, Windows 7 has some native shortcuts, which I don't use because I bind Win to left mouse click:

  • Win + Shift + Arrow Left to move a window to the left monitor
  • Win + Shift + Arrow Right to move a window to the right monitor

Like you I have 6 monitors so I also need to move a window to the bottom/top in my case between monitors 3 and 4 and between monitors 5 and 6:

enter image description here

I saw that AHK might have some functions for it, e.g. WindowPad and WindowPadX, but it's not clear to me how to set such a keyboard shortcut, so I asked the question here a while ago: Move a window to the bottom/top monitor with a shortcut on Windows

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.