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

With the 4 monitor setup that I use one of the pitfalls is that I spend a lot of time moving the mouse cursor across 2 or more screens at a time.

I would like a piece of software for WinXP that when a window receives the focus, if the mouse is not already within that window, moves the mouse to the centre of that window.

Any ideas?

share|improve this question
Would it also help if mousing over a windows makes it focused? – Ivo Flipse Jul 29 '09 at 7:23
Nah. It's the mouse moving not the clicking that takes time. – LachlanG Jul 29 '09 at 7:34
up vote 4 down vote accepted

Edit: an easier method!


(For Windows XP and Vista)

AltTab is a compiled AutoHotKey script that just moves the mouse near the origin of the active window when you use the AltTab hotkey combination in Windows to bring another window to the forefront

The hard way:

Use AutoHotKey to move the mouse to the center on Alt+Tab:

KeyWait, Alt
KeyWait, Tab
WinGetPos, X, Y, width, height, A

There you go Tiago ;-)

share|improve this answer
It works fine for a real machine but unfortunately doesn't work for a VMWare Workstation guest. Any suggestions? – LachlanG Sep 9 '09 at 1:25

The AutoHotKey script above didn't work for me, I had to make some minor changes. MouseMove is relative to the current window position, not the screen position. It also would not always move the mouse to the window if it was minimized. I added a Sleep statement to work around that.

KeyWait, Alt
KeyWait, Tab
Sleep 300
WinGetPos,,, width, height,A
share|improve this answer

The only software setting I am aware of is in the Microsoft IntelliMouse software which allows you to do a Snap to Default Button. This however only works for dialog boxes.

I did however find this registry hack, however I haven't tried it myself.

  • Start
  • Run
  • Regedit
  • Make Changes
  • Exit RegEdit
  • Reboot
Registry Key: HKEY_CURRENT_USER\Control Panel\Mouse
Data Type: REG_DWORD [Dword Value] 
Value Name: ActiveWindowTracking
Setting for Value Data: 
[0 = ActiveWindowTracking Disabled]
[1 = ActiveWindowTracking Enabled]

Alternatively you can also have a look at using AutoHotKey. It might have a way to map this from some forum entries I have read.

share|improve this answer

I let myself decompile the @IvoFlipse's script, and then tweak it a bit to move the mouse to the center of the window, here's the result:

; After Alt-Tab, move mouse to center of newly activated window.
;  - updated based on;
;  - modified to try to move to center of window.
KeyWait, Alt
KeyWait, Tab
While (x < 0 Or y < 0)
share|improve this answer

It does not work with two screens attached. It seems that the script thinks the window on screen #2 is on screen #1 and move the screen to the right position but on the wrong screen.

share|improve this answer
Have you tried the others mentioned here? Your 'Answer' is better posted as a comment to the answer to which it applies, as it is not an answer. – HaydnWVN Dec 10 '12 at 15:16

You must log in to answer this question.

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