Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is there a program that can list me the "main" window position, given I know only PID; or something like window position? (please feel free to correct wrong assumptions.) I'm on windows.

EDIT For example I have a PID of a running executable. And I know it has a window but it went off-screen and I don't know the HWND. While surely there are techniques to bring it on-screen, I would like to know it's window position first.

share|improve this question
please explain downvote if you can, so I can improve my quiestion! :) thanks! – n611x007 Sep 8 '13 at 20:04
Is there a program that can in a 'refreshing manner' ("real-time") list me a pid's main window position, or something like that? Does it have to be auto-refreshing? For example I have a pid I know it has a window but it went off-screen. While surely there are techniques to bring it on-screen, I would like to know it's position first. PID? A PID is a process-identifier which is for a program, not a window. A window would have a HWND which is a unique handle to it. A program may have multiple windows. – Synetech Sep 8 '13 at 22:44
@Synetech yes, I mean that I won't know the hwnd because I also lack the ways to query them. I only know the PID since that is listed in task list. Regardless your answer solves both my problems. :) Well, auto-refreshing is not so important after all, I can do reoccuring queries you are right, I will edit my q. – n611x007 Sep 9 '13 at 6:27
up vote 2 down vote accepted

You can use WinSpy++. If you have the handle (HWND) to the window (as opposed to the PID of the program), then it will be easier.

  1. Run WinSpy++
  2. Locate the desired window:
    • With HWND:
      1. Enter the HWND of the window in the Handle field
      2. Press Enter
    • Without HWND:
      1. Expand its window to show the list of windows
      2. Locate the program that the missing window belongs to
      3. Expand the program’s branch
      4. Locate the missing window in the sub-branch
  3. Look at the Rectangle field in pane on the left
  4. Click the [Refresh] button if/when desired
  5. Click the […] button to move the window
share|improve this answer
Glad it worked out. Also, if the missing window happens to have a taskbar button and you simply want to get it back on screen, then you can click the taskbar button, press Alt+Space, M, an(y) arrow key, then move the mouse. It will instantly snap back on screen. (Alternately, you can right-click the taskbar button or Alt-Tab to it before moving it.) – Synetech Sep 9 '13 at 15:40
Thanks, handy to have this info close here too! :) I knew this trick once but always forgot. (However this time I was also looking for the position first, to help me grasp what happened in my particular application before it went off-screen by the direction + distance.) – n611x007 Sep 9 '13 at 16:53

You must log in to answer this question.

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