Friday, October 24, 2008

Moving an Offscreen Window in XP

About a month ago, I setup a second monitor on my work computer. It's sweet: I can drag windows off my main monitor, and over to my second monitor. This is especially useful when I'm firing off a process that I want to keep an eye on, but I want to keep working on my code. Much better than switching back and forth between my IDE and the process window, and a lot less distracting.

Because I work from home at least one day a week, it wasn't long before I logged into my work computer from home, and discovered that the windows were still lost on the second monitor! Since I only have one monitor at home, I have no way to get to those windows.

Okay, so I tried a couple of things: the most obvious solution is to close the application, and restart. Unfortunately, for like 99% of the applications out there, it remembers it's last window placement location, and returns to that location on next launch. I tried using ALT-TAB, but that just changes focus to the window without moving it.

Doing a Google search, there's actually a lot of helpful advice out there. For the most part the solution is this:
  1. Right-click the window's taskbar button

  2. Select Move

  3. Tap an arrow key

  4. Move the mouse

Well, that's great advice as long as the window you are trying to move HAS a taskbar button, AND the right-click menu has an ENABLED move option. If either of these two things is missing, this advice is useless!!

Back to Google, and some more fine tuning of my query, and some trial and error, I found a solution that worked for me in every case I've tried it:
  1. Use ALT+TAB to find the window you want to move


  3. Press the 'M' key

  4. Tap an arrow key

  5. Move the mouse

Whew! That was harder than it should have been! Hope this helps you!

ps - I know somebody will point out the "Tile Windows xxxx" options as a possible solution. Despite thrashing all my windows at once, it actually only ends up tiling windows that have task bar buttons. If you have a window that doesn't have a task bar button (like CCTray) the only solution I'm aware of to recover the window, is the one I give here.


Don Snabulus said...

I do the same dual to single monitor thing, but I usually don't sleep or hibernate the laptop so my Windows generally appear on the main screen.

I like the keystroke magic though. I am going to remember that combo because I foresee the same thing happening to me at some point.

DewKid said...

It took me a second to realize that you were talking about using the same computer here. In my case, my work computer is a desktop machine, and I'm using "Remote Desktop" to access it from home. (I guess I wasn't very clear about that in my post.) Anyway, if I forget to move windows off my second monitor before going home, I end up with this problem. Since I live an hour drive away from work, it's a real problem!

The Moody Minstrel said...

Why not just add a second monitor to the home computer?


Anonymous said...

Awesome. You may have actually saved a computer's life tonight. I normally operate this notebook in a docking station with two large monitors, but when I bring it home, I just have the small built-in screen. The window I needed to move actually had a taskbar button so I was able to use the first method you documented to move the window onto my screen.

Anonymous said...


DewKid said...

Anonymous: nope, it doesn't.

Assuming you even read the blog post, remember that this is me at home with one monitor trying to access an app at work through remote desktop to a computer with two monitors. Also, the app in question DOES NOT HAVE a task bar handle, which means you can't bring focus to that application normally.

In any case, your suggestion doesn't even work in the normal situation, which suggests to me that you have a 3rd party tool installed which does this.

Oh, and Moody, you can't just add a second monitor at home. Remote desktop doesn't work like that.

Sorry guys, the solution I posted is the only native XP way to do this, bar none.