I have a dual monitor setup, and I recently played around with the positioning settings, and some of my single window applications do the favour of preserving where they were last closed, and opening in the same position later. Unfortunately, that now places them out of the viewable area of my screens!
Is there some way to force a particular window into the viewable area?
421 Answers
For Windows 7 and later users: +Shift+← or → will move the selected window to the monitor in that direction.
I use this approach:
- Use Alt+Tab to switch to the off-screen application.
- Press Alt+SPACE to bring up the system menu (you won't see it because it is off screen)
- Press R to select the "Restore" menu choice to ensure the windows isn't maximized (you cannot move it if it is maximized)
- Press Alt+SPACE again, then M to select the "Move" menu choice.
- Press one of the arrow keys to initiate the movement.
- Now just use the mouse to place the window where you want.
If you are using a non-English version of Windows, the "R" and "M" menu choices will probably be different.
9For Windows 10 in order to use the old move the window with the cursor keys trick you need to have the Shift key pressed when you open the context menu from the Task bar.
Info from How To Geek
3You can right-click the program's button on the taskbar, and then click "Move". You can now use the arrow-buttons on your keyboard to move the window where you can see it. Requires some fiddling, sometimes the windows get "stuck" on the monitors edges. You can also try using the mouse, but the keyboard is a bit more reliable if you can't see the window yet ;-)
7Back before there was the task bar, I used to fix this problem with Alt+Space to bring up the window menu, then M for the Move function. The arrow keys would then allow you to move the window back on-screen.
1Another fast way is to r-click on the task bar and select Cascade Windows.
2I ran into this problem, and absolutely nothing worked for me. So I went into Task Manager, and right-clicked the program that was off screen. Switch to didn't work, nor did bring to front. To note, this was a static window, so maximize was unavailable via the taskbar. But you can maximize via the Task Manager, and that brings it to your main display! From there you can do whatever you need to with the window. :)
1You could use NIRSOFT WinLister. I noticed the “Move” method is not available on Windows 7 when you are using the classic theme, and various other methods failed so I’m posting my “IF all else fails” alternative.
Download the WinLister application here.
Run WinLister as Administrator and select the window you wish to move back on Screen. Not running as administrator will not give the application the ability to move the windows for you.
Right click and select “Center Selected Windows” and you’re done!
Screenshots here.
3Edit: Discontinued as per comments
To quickly solve this problem in the future, and to position applications over the dual-screen I can recommend Winsplit Revolution. It reduces solving this problem to simply pressing Ctrl-Alt and a num-pad key to put the window back exactly where you want it.
6I use a nifty little tool called Shove-it which simply checks whether any window is outside the screen edge and shoves it back onto the screen again. It's ancient software (and the homepage proves it) but works on all Windows versions.
6I just ran into this problem with Git GUI on Windows 7, which is based on Tk and as such tends to glitch out in weird ways at times on Windows. I tried hitting Alt-Space and using the move command to shimmy it back into view, but it seemed stuck. Maximising it would bring it back, but if I put it back into windowed mode it would disappear again.
What I did was maximise it, grab the title bar, and drag it to the side of the screen so that Aero Snap sized it to half the screen size and put it into windowed mode. After that, I dragged it away from the side of the screen, and regained control of it.
2I had the same issue with winamp. The only (unsatisfactory) solution i found so far: change the screen resolution to a different one and back
Thomas
In some cases, despite having multiple screens at the remote location, you may not have access to them from your location. The key commands won't work because you have been locked out of any view that is not on your screen.
In this case, if you can open additional instances of the application, do so. The first few instances will almost certainly appear in the task bar as yet more phantom windows. Keep doing this. Eventually, they will begin to populate the primary view. Then use the task bar icon to right click and close the off-screen instances. Once there are NO off-screen instances open, close the ones on the primary screen. Next time you open that application, it will appear on the primary screen and not "off camera."
2Select the window (e.g., using Alt+Tab). Then hold Alt+F7 and move the window with the arrow keys back into view. Done.
Sometimes it is hard to know blindly where the hidden window is located (and thus how to move it towards the screen). Animations during selection of the window might be helpful. Due to my setup (I occasionally use a second screen on top of my laptop screen), windows that appear off screen are usually below. Holding Alt+F7+Up therefore brings them into view.
For anyone familiar with PowerShell, try this:
- Copy & paste the below code into a PowerShell ISE session.
- Hit Run
- Press ALT+TAB / whatever to make the off-screen window active
- Wait a few moments (5 seconds from hitting RUN on the script)
- The window should now appear.
If the window is a main window, it will be moved to the top left corner of the screen.
If the window is a child window of another program, its top left corner will be aligned with its parent window's top left corner.
Add-Type @" using System; using System.Runtime.InteropServices; // (v=vs.85).aspx public struct RECT { public long left; public long top; public long right; public long bottom; } public class User32WinApi { // (v=vs.85).aspx /* Gets the handle of the in-focus window NB: In some scenarios this can be NULL; so code needed to handle such an event */ [DllImport("user32.dll")] public static extern IntPtr GetForegroundWindow(); // (v=vs.85).aspx /* top & left are always 0 (i.e. since the rectangle is relative to the window itself) bottom & right equal the windows hieght and width, respectively. */ [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool GetClientRect(IntPtr hWnd, out RECT lpRect); // (v=vs.85).aspx [DllImport("user32.dll")] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint); }
"@
$repaint = $true
$windowSize = New-Object RECT
"Quick; get the window you're after in focus; you have 5 seconds..."
Start-Sleep -Seconds 5 #allow 5 seconds for the user to get the window they're after in focus (e.g. using ALT+TAB / whatever)
$activeWindow = [User32WinApi]::GetForegroundWindow()
if ($activeWindow) { if([User32WinApi]::GetClientRect($activeWindow, [ref]$windowSize)) { if ([User32WinApi]::MoveWindow($activeWindow, 0, 0, $windowSize.right, $windowSize.bottom, $repaint)) { "Window moved successfully (hope you agree!)" } else { Write-Warning "Failed to move the active window" } } else { Write-Warning "Failed to get size of the active window" }
} else { Write-Warning "No active window found"
}Original code here:
put cursor on task bar..right click select show window side by side..it will bring the window on screen..and finally bring again cursor on task bar right click select undo show window side by side..
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.
From Move a window to the bottom/top monitor with a shortcut on Windows by Tymric:
I wrote an AHK script.
Usage:
Win + Alt + Arrow: Move the active window to the monitor whose direction is indicated by the arrow. Note that this may cause your window to move outside the screen if you try to go up from monitor 2 or right from monitor 3 in your setup. I'll update it in the future.
Win + Alt + Number: Move the active window to the given monitor number
#Persistent
SysGet, MonitorCount, MonitorCount
#!Up:: GoSub CalculateDisplacement WinMove, A, , %xPos%, %displaceYneg% return
#!Down:: GoSub CalculateDisplacement WinMove, A, , %xPos%, %displaceYpos% return
#!Left:: GoSub CalculateDisplacement WinMove, A, , %displaceXneg%, %yPos% return
#!Right:: GoSub CalculateDisplacement WinMove, A, , %displaceXpos%, %yPos% return
#!1:: GoSub CalculateDisplacement WinMove, A, , %xPosOn1%, %yPosOn1% return
#!2:: if (MonitorCount > 1) { GoSub CalculateDisplacement WinMove, A, , %xPosOn2%, %yPosOn2% } return
#!3:: if (MonitorCount > 2) { GoSub CalculateDisplacement WinMove, A, , %xPosOn3%, %yPosOn3% } return
#!4:: if (MonitorCount > 3) { GoSub CalculateDisplacement WinMove, A, , %xPosOn4%, %yPosOn4% } return
#!5:: if (MonitorCount > 4) { GoSub CalculateDisplacement WinMove, A, , %xPosOn5%, %yPosOn5% } return
#!6:: if (MonitorCount > 5) { GoSub CalculateDisplacement WinMove, A, , %xPosOn6%, %yPosOn6% } return
#!7:: if (MonitorCount > 6) { GoSub CalculateDisplacement WinMove, A, , %xPosOn7%, %yPosOn7% } return
#!8:: if (MonitorCount > 7) { GoSub CalculateDisplacement WinMove, A, , %xPosOn8%, %yPosOn8% } return
#!9:: if (MonitorCount > 8) { GoSub CalculateDisplacement WinMove, A, , %xPosOn9%, %yPosOn9% } return
CalculateDisplacement: WinGetPos, xPos, yPos, , , A Loop, %MonitorCount% { SysGet, MonitorDimension, Monitor, %A_Index% if (xPos > MonitorDimensionLeft and xPos < MonitorDimensionRight and yPos < MonitorDimensionBottom and yPos > MonitorDimensionTop) { currentMonitor = %A_Index% } } SysGet, thisMonitor, Monitor, %currentMonitor% displaceXpos := xPos + thisMonitorRight - thisMonitorLeft displaceYpos := yPos + thisMonitorTop - thisMonitorBottom displaceXneg := xPos - thisMonitorRight + thisMonitorLeft displaceYneg := yPos - thisMonitorTop + thisMonitorBottom Loop, %MonitorCount% { SysGet, nextMonitor, Monitor, %A_Index% xPosOn%A_Index% := xPos - thisMonitorLeft + nextMonitorLeft yPosOn%A_Index% := yPos - thisMonitorTop + nextMonitorTop } return I've written a tool called Borderline that will automatically move off-screen windows back on-screen when run. You have to run it when you need it (works best if you assign it a keyboard shortcut or put it in the start menu), but that also means it's not always running in the background.
Sometimes, this solved:
- Click WinKey + P
- Choose to
Extendor another option, and all windows will be cascaded. Move the desired window to primary screen.
How to move windows that open up offscreen?
Temporary lower the screen resolution, grab the top bar with the mouse and move the the center. Wait for the system to automatically restore the resolution.
- DeskTop -> Screen resolution
- Select your monitor, change to some lower resolution from the current setting.
- System shows the new resolution, asks if you want to keep or revert in 30 seconds.
- Within 30 seconds, grab the miss located window and move it to the center.
- Wait for the time out to automatically revert.
Window moved...