In Windows XP using TweakUI I could enable an option so that when my mouse goes over an inactive window, it makes that window the active window. There is also another separate option so that if the window becomes active, it automatically becomes the topmost window.

I like to enable the former but not the latter.

For Windows 7 I have not been able to find the same thing. What I found instead is an option inside windows that does something similar. If I move my mouse over an inactive window, I have to hover over it for a while before it becomes active. It is not instantaneous. The second problem is that once it does become active, it automatically makes itself the topmost window, covering other things I don't want covered.

In summary, this is what I want in Windows 7:

  1. When my mouse goes over an inactive window, it immediately makes it the active window.

  2. When it activates the window, it does not raise it above other windows.

  • Very poorly written question. You're asking about a TweakUI feature in WinXP. Not a Win XP feature. Your title doesn't make that clear
    – barlop
    Apr 12, 2021 at 9:58

4 Answers 4


Thanks Phoshi for your answer. Since I stumbled on this link from a google-search I'm going to fill in some of the information missing from here and give a complete step-by-step guide for it:

To get X-mouse working from a Vanilla Windows 7 install:

  1. Open the Control Panel
  2. Choose "Ease of Access"
  3. Choose "Change how your mouse works"
  4. Tick the box next to "Activate a window by hovering over it with the mouse" and hit "OK".
  5. Open regedit
  6. Locate HKEY_CURRENT_USER\Control Panel\Desktop\UserPreferenceMask - change the first byte only, you need to subtract hexidecimal 40 from value that is there (eg DF becomes 9F) - this disables Auto-raise on Activate
  7. Locate HKEY_CURRENT_USER\Control Panel\Desktop\ActiveWndTrkTimeout - change its value to something small. Lower values will make it more difficult to use floating temporary windows (such as the taskbar notification area widget) because they disappear of something else gets focus as you move to them, but lower values also improve responsiveness. You might start with 250ms and tweak it from there.
  8. Log out, log back in, et voila,...

Steps 1-4 were mentioned in passing in the question, but not enumerated.

Steps 5-8 are exactly what Phoshi said.


Instead of manual registry hacks, try using system calls from SystemParametersInfo, especially SPI_GETACTIVEWINDOWTRACKING, SPI_GETACTIVEWNDTRKZORDER, SPI_GETACTIVEWNDTRKTIMEOUT. Using these calls also save you from having to log out/in in order to apply the settings. I would recommend using X-Mouse Controls, which implements them.

X-Mouse Controls: A tool to enable or disable active window tracking, raising and also the delay in milliseconds. This is known as x-mouse behavior.

You only need to run it once, it is small, open source and takes care of the details for you.

Screenshot of the main window of X-Mouse Controls, running on Windows 10

  • 3
    Thank you! A minimalist GUI front-end that [1] allows changing w/o needing a log out/in, [2] doesn't make me muck around with hexadecimal conversion in the registry, and [3] propagates changes to ease of access center so that it seems like it's doing things 'properly'. Apr 8, 2012 at 17:44

Right then!
Open regedit, and let's get to work.


HKEY_CURRENT_USER\Control Panel\Desktop\UserPreferenceMask

into 9F 3E 07 80 12 00 00 00

Then change

HKEY_CURRENT_USER\Control Panel\Desktop\ActiveWndTrkTimeout

to 0 (you might have to switch the datatype to decimal).

Then log out, log in, and (hopefully) enjoy your window switching!

  • Works, but makes accessing hidden icons in the taskbar impossible. I click the arrow to expand the list, then when I try to move my mouse to the box it disappears before I reach it.
    – Phenom
    Nov 29, 2009 at 1:49
  • Nevermind, I can access it I click on the arrow, then press tab to activate it.
    – Phenom
    Nov 29, 2009 at 1:53
  • A little icky, but workable, I guess. You could use alt-tab more, maybe?
    – Phoshi
    Nov 29, 2009 at 10:16

This AutoHotkey script does that. Check the first lines, there are some parameters that change the behavior of the script:

hover_task_buttons  = 1 ; hover over taskbar button to activate window
  hover_task_group  = 1 ; hover to select (or exit) from a window-group menu
                        ; (for Windows' "Group similar taskbar buttons" feature)
hover_task_min_info = 0 ; only show info for minimized windows, don't activate
hover_start_button  = 1 ; hover over start button to open start menu
hover_min_max       = 1 ; minimize or maximize by hovering over the min/max buttons
hover_any_window    = 0 ; activate any window by hovering (except the taskbar)

hover_no_buttons    = 1 ; ignore hover if a mouse button is in the down state

hover_delay       = 500 ; hover delay, from when the mouse stops moving

; WORKS, BUT NOT PERFECTLY: (brings the window forward, then puts it back in place)
hover_keep_zorder   = 0 ; don't bring windows forward, only activate them

You'll be interested in the last one listed above, hover_keep_zorder, with the caveat that it does not work perfectly (it worked fine for me though).

Don't forget to also set hover_any_window to 1.

  • Vote timeouts are getting silly! I accidentally clicked ^ again, taking my previous upvote away, and now it won't let me re-upvote!
    – Phoshi
    Nov 28, 2009 at 21:50
  • Finding a trivial point to edit was difficult, darn your well-formed text :P
    – Phoshi
    Nov 28, 2009 at 21:52
  • Works, but makes accessing hidden icons in the taskbar impossible. I click the arrow to expand the list, then when I try to move my mouse to the box it disappears before I reach it.
    – Phenom
    Nov 29, 2009 at 1:45
  • Oops, the above comment was meant for the person with the reg hack. I tried this and it didn't do anything.
    – Phenom
    Nov 29, 2009 at 1:46
  • Perfect solution!
    – RamValli
    Mar 7, 2016 at 6:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.