310

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?

23 Answers23

482

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.

Run5k
  • 16,463
  • 24
  • 53
  • 67
Terje Mikal
  • 5,287
236

For Windows 7 and later users: Windows Key+Shift+ or will move the selected window to the monitor in that direction.

Run5k
  • 16,463
  • 24
  • 53
  • 67
andho
  • 2,482
31

For 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.

enter image description here

Info from How To Geek

Brad Patton
  • 10,668
14

You 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 ;-)

11

Back 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.

Greg Hewgill
  • 5,619
11

Another fast way is to r-click on the task bar and select Cascade Windows.

T. Kaltnekar
  • 8,484
7

I 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. :)

Leo
  • 71
6

Edit: 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.

Andy
  • 654
6

You 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.

  1. Download the WinLister application here.

  2. 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.

  3. Right click and select “Center Selected Windows” and you’re done!

Screenshots here.

3

I 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.

unused
  • 31
3

I 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.

1

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."

Greg Mayer
  • 11
  • 1
1

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;

    // https://msdn.microsoft.com/en-us/library/windows/desktop/dd162897(v=vs.85).aspx
    public struct RECT 
    {
        public long left;
        public long top;
        public long right;
        public long bottom;
    }

    public class User32WinApi 
    {

        // https://msdn.microsoft.com/en-us/library/windows/desktop/ms633505(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();

        // https://msdn.microsoft.com/en-us/library/windows/desktop/ms633503(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);

        // https://msdn.microsoft.com/en-us/library/windows/desktop/ms633534(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: https://gist.githubusercontent.com/JohnLBevan/1593bbb860c2d2af436a1c9414e8adfa/

1

I 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

Thomas
  • 11
1

Select 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.

Georg Jung
  • 1,449
0

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

Franck Dernoncourt
  • 24,246
  • 64
  • 231
  • 400
0

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
Franck Dernoncourt
  • 24,246
  • 64
  • 231
  • 400
0

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.

jamesdlin
  • 3,314
0

Sometimes, this solved:

  • Click WinKey + P
  • Choose to Extend or another option, and all windows will be cascaded. Move the desired window to primary screen.
T.Todua
  • 4,053
0

Right-click the thumbnail which appears when you hover over an app button in the taskbar, click Move. Use or keys to start moving the window, then use your mouse to position the window.

This window menu is also accessible with keyboard:

  1. Press Windows+T to focus the first app button in the taskbar,
  2. Continue pressing Windows+T until you reach the app you need or use or keys to move between buttons;
  3. Press to select the first window thumbnail of the app, if required, use or to select another window;
  4. Press Shift+F10 or Menu if it's available on your keyboard;
  5. Click Move and use or keys to start moving the window.

The above is just another way to access the same window menu that's mentioned in Terje Mikal's and Brad Patton's answers, it displays the window menu which is accessible by Alt+Space.

If the Move command is disabled, you may need to click Restore first.

0
  • Move another window to the left or right until your mouse cursor reaches the border of the screen. This will make this other window fill half of the screen. In the other half of the screen, a list of the other windows will appear.
  • In the list, click on the problematic window. This will make the problematic window visible and make it fill half the screen.
  • Don't immediately maximize the problematic window, otherwise restoring it back down will make it invisible. Instead, move the window slightly down, so that it is visible but not maximized. Then you can maximize it if you want.
root
  • 1,799
0

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..

ravi21
  • 1
-1

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.

  1. DeskTop -> Screen resolution
  2. Select your monitor, change to some lower resolution from the current setting.
  3. System shows the new resolution, asks if you want to keep or revert in 30 seconds.
  4. Within 30 seconds, grab the miss located window and move it to the center.
  5. Wait for the time out to automatically revert.

Window moved...

Linger
  • 3,332
  • 10
  • 38
  • 47
Russ
  • 1