How-To Geek
Switch Windows by Hovering the Mouse Over a Window in Windows 7 or Vista
This isn’t for everyone, but you can enable a mouse mode in Windows 7 or Vista where just hovering over a window with the mouse will switch to that window. In the old days, this used to be called the XWindows mode, and was enabled through TweakUI, but now it’s built right into Control Panel for everybody to use.
To turn this setting on, just type “mouse works” into the search box in the Control Panel, and you should see an item called “Change how your mouse works”.
In this screen, scroll down and find the checkbox for “Activate a window by hovering over it with the mouse”.

That’s pretty much it. It’ll take a while to get used to the new mode… just remember, the mouse has to be hovered over top of any window to switch focus to it.
Got Feedback? Join the discussion at discuss.howtogeek.com
Comments (53)
Programmer by day, geek by night, The Geek, also known as Lowell Heddings, spends all his free time bringing you fresh geekery on a daily basis. You can follow him on Google+ if you'd like.
- Published 06/9/07




I knew I’d seen this setting somewhere… This feature is more useful than you’d think – especially when you’re using multiple monitors running full-screen programs.
Worked for me! Thanks!
Linux has had this for ages, thank you MS, for making a stable OS with it!
I don’t have the option selected to “Activate a window by hovering over it with the mouse” but it still does it!!!
It’s driving me nuts. Anyone know how to fix this??
System restore, checking the box, clicking OK, then unchecking, or just wait – mine did it for a while, then stopped for no apparent reason.
Vista!
I must be really dense here. If you have to hover over the top of the window to make this work, why not just click on the title bar and be done with it?
What if I don’t want it to raise the window? I just want it to get focus, not focus and raise it.
And is there any way to adjust the delay?
Using Windows 7 btw, and the procedure is the same as in Vista. At least for the activation of the Ease of Access Center.
Spacegold: Some of us just want to move the mouse over the window and be ready to write without having to click, clicking the window raises it, and that’s not the point. At least not for me. Even if I have three monitors at 2048×1536 I still clutter up my desktop with windows covering each other..
I totally agree with Perry. I want to give the window focus only, not raise it. That’s the way XWindows worked in TweakUI. Adjusting the delay would be nice also. Has anyone found a resolution to this?
Hi Roger.. I have found a solution for this, at least for my own usage.. ;)
Check out this one: http://fy.chalmers.se/~appro/nt/TXMouse/
It works just like the Xmouse in Linux/Unix with the copy on select text and all that as well. Together with lowering windows by right clicking the toolbar. No way I’m going back to normal Windows(TM) mouse functions..
Awesome! I have to use a PC at my new job and and anything I can do to make it work like my beloved Mac at home is greatly appreciated.
Note to PC retardos like myself: You have to be in “Control Panel Home” and not “Classic View” for the search to return a result.
Perry, Thank you for pointing me to TXMouse. I used to be a Unix admin & came to rely on the abilities given by a true XMouse. I have used the TweakUI XMouse for years on XP, but always considered it a partial solution at best because clicking inside a window still brought it to the top even if all I wanted was to copy a small piece of text for paste elsewhere. After going to Vista & using the above control panel solution I felt even more function go missing. I had to disable the Vista “solution” before I got full funtion back, but TXMouse is awesome!
I strongly endose this for anyone who wants real XMouse funtionality!
Hey guys, I played with TXMouse and found it to be a poor replacement for the options TweakUI offers. I hate having a delay in focusing windows and I REALLY hate the bring to the front that the Windows 7 checkbox gives you.
For those of you who love to have your mouse cursor autofocus on the window it’s hovering over with NO delay and being able to click anywhere on a window to bring it to the foreground, this is for you!
Step #1:
Open regedit, go to HKEY_CURRENT_USER\Control Panel\Desktop
Edit UserPreferenceMask value to be 9F 3E 07 80 12 00 00 00
You should only have to modify the first pair.
Step #2:
In the same place in regedit, edit ‘ActiveWndTrkTimeout’, change ‘Base’ to Decimal and put in 0 as the ‘Value Data’
Step #3:
Log off and log back in
Step #4:
Bask in the glory of your instant autofocus that doesn’t bring the window to the foreground, doesnt force you to click on the title bar or frame of a window to bring to front, and most importantly, DOESN’T SUCK or force you to use 3rd party application!!
Hopefully someone else finds this as useful as I did!
To unpaidbill:
My compliments. Joy abounds. I’m a retired Unix Admin of many years and this feature has been sorely missed on my Vista systems.
The registry fix works – window focus shifts instantly and windows (in focus) do NOT pop to the top of the view.
Thanks!
@unpaidbill: The registry tweek worked great — it’s exactly what I was looking for! However, I seem to be getting one negative side effect — I can’t access my hidden toolbar items any longer because the box containing them disappears as soon as I move my mouse to it from the toolbar.
Set ‘ActiveWndTrkTimeout’ to 50 rather than 0, it’s instant enough that you wont notice, but slow enough to let you get at the hidden systray icons.
In linuc, if you select something like a line of text, it will automatically put that selection in the clipboard so you can middle click and paste it. Is there a way to turn that on in windows vista or 7?
*linux
@Jerry_nz jupt this works perfectly if you use TX Mouse http://fy.chalmers.se/~appro/nt/TXMouse/
Even with the active focus I find there is a short delay switching between windows. I use applications that allow to switch between windows using the keyboard. There is a small delay (very annoying when you do it hundreds of times) to raise the other window.
Taking out all animations in Windows 7 does not improve the raise speed.
Any ideas?
I have XP Pro, and TXMouse is works pretty well, for the most part. unpaidbill’s solution works somewhat, but not always. What is really lacking in the solutions I’ve tried is the ability to scroll subwindows, e.g. panes in regedit or eclipse (IDE), without having to give them the focus. Is this a MS “feature” that cannot be overcome?
I completely agree with Perry, Roger and gonzoo: hover-to-focus isn’t much use if there isn’t a way to turn auto-raise off. I don’t understand why M$ hasn’t added this essential option—haven’t those people every used a real operating system? =P
Luckily, a bit more web searching has revealed a registry tweak that still gets the window manager to behave properly. It’s our old friend UserPreferencesMask in [HKEY_CURRENT_USER\Control Panel\Desktop]: assuming ‘Focus Follows Mouse’ is turned off, adding 41h to the first number in the binary key “UserPreferencesMask” is the same as turning it on. But if you only add 1, you get focus follows mouse without auto-raise. Hazah!
So, the value for my key was “9E 3E 07 80 12 00 00 00″. I edited it to “9F 3E 07 80 12 00 00 00″ to get “focus follows mouse” (9E + 1 = 9F).
Thank you, Thank you, Thank you for giving this information about how to activate a window by hovering over it with the mouse. I DON’T LIKE this feature at all. I’ve had a laptop for a year and a half with this feature enabled and it has cause me a LOT of frustration. The mouse frequently jumps off the edge of the window that I’m working on and automatically switches to another window when I don’t want it to. I’ve had to continually watch out where my mouse pointer is located or else it would switch to another window. I’ve searched the Intenet before trying to find out how to turn it off, and I’ve search through the Windows Vista help systems, but to no avail.But now, by following your instructions I was able to TURN OFF that feature.
Thank you again. I very much appreciate this article.
Best Wishes,
Stephen
Note instructions above. Adding 41 to the first byte (9E) does 2 things:
“1″ Sets the application Active that you hover over.
“4″ Will Pop Forward the application you hover over.
Also works with Windows 7. However, there is a problem when setting UserPreferencesMask to 0 in Windows 7. Whenever you right-click a loaded application on the task bar (or the ^ displaying running tasks), the application pop-up will disappear as soon as you move off the application icon. This is due to the gap between the task bar and the pop-up. Setting UserPreferencesMask to 100 dec (64 hex) sets the delay to 100 ms which will give you enough time to move the mouse to the pop-up.
There’s a pretty big bug with this feature, preventing me from using it. If you turn this feature on, then press alt-tab, the mouse moves to the new window. I guess you get one or the other.
In summary the settings (with reboot) below worked fabulous for me in Windows 7 Professional/64 bit edition on an iMac under bootcamp.
HKEY_CURRENT_USER\Control Panel\Desktop
UserPreferenceMask: “9F 3E 07 80 12 00 00 00″
ActiveWndTrkTimeout: 50
Comments: Very Unix-like/XMouse experience forgot I was on Windows after the restart. Given that Windows has the right controls it’s sad that MS did not build in a second checkbox for XMouse without autoraise. Hint!!!
I have tried different values in ActiveWndTrkTimeout. Started at 0, then I got annoyed with not being able to Rclick taskbar tiles, so tried to increase the number to 100, then 1000. but each time i log off and on again, there still seems to be no delay and window switching remains to be constant. if go into regedit again, the value is as i set it (at say 100) but there is no delay.
anone else noticed this. do i need to do something special to activate the registry change?
Michael Scheper’s fix is a useful one and does work for XP. Can I suggest an improvement?
Instead of directly changing the hex value of the key, firstly rename it. I called mine ‘UserPreferencesMask_orig’.
Then create a new Binary Value Key with the ‘UserPreferencesMask’ name and copy the wanted hex string (as given by Michael) into its value data field (depending on whether the “window auto focus under mouse” feature should be ON or OFF). This allows for a return to the original value(s) in case things don’t work out as expected!
Also set the location under Favorites > Add Favorites in the Regedit Menubar with a useful name to enable it to be quickly found again.
when i typed that “mouse works” then it opened in explorer tab.not worked for me. and where is that other search bar….??????????
and how it works in xp. plz tell me
any one???
plzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
i only want that hovering effect. plzzzzzzzzzzzzzzzzzzzzz
but in xp
i tried many softs but no one worked
plzzzzzzzzzzzzzzzz help me
any one???????????????????????????
thanks so much, it’s been bugging the crap out of me not being able to find that option. :- )
mercedframer.com
there’s still a delay, Im already using
Userpreferences: DF 3E 07 80 12 00 00 00
ActiveWindTrack Timeout 1 Hex or 0 Decimal
system: windows 7 x64
what else can I tweak? I really want instant activation the moment the mouse hovers a window.
disregard my last post, I know where I got it wrong.
Thanks!!!
is there a way to make this work for specific types of windows?
or at least a macro/shortcut to turn it on and off will do :)
I know this is old as heck but does anybody know if this functionality can be turned on *only* when dragging files to a window? It seems like this new version of windows will let you drag an object from anywhere and put it anywhere you want in the start menu (waited years for this!) but now I have trouble moving files properly between folders with any window overlap.
Here is a simple program which will do the trick for you.
http://d.hatena.ne.jp/bellbind/20091203/1259789832
The web site is in Japanese, but you can just grab the program XMouseSetting.zip which is written in English.
I need to get rid of the mouse over blue highlights. NOT the desktop icons.
Also ich bin mir sicher dies war nur ne kurzweilige Erscheinung
Also ich glaube das war lediglich ne Mode
Does someone knows how to get the focus follow the mouse without tweaking the registry (i am not administrator and registy access is restricted).
TXmouse does the trick but the middle click functions are lost in application such as firefox (open in Tab, close Tab …).
If I had access to the registry I would make firefox an exeption but …
I would like either a way to do it or a way to make firefox works as usual with TXmouse
Any idea?
You should have full control over your own HKEY_CURRENT_USER section which means you might not need administrative access to change it.
Thanks for your answer!
I am afraid my administrator is kind of brutal: I simply have no access to the regristry.
my TXMouse.reg:
”
REGEDIT4
[HKEY_CURRENT_USER\Software\\TXMouse]
“AutoRaiseDelay”=dword:0
“ExemptedClasses”=”*”
“ExemptedModules”=”*”
“RapidClickInterval”=dword:000000001
“TwoButtons”=dword:0
”
When I execute this, I get a message saying that registry modification has been disable by admin.
:-(
thanks a mil, was looking forever to find this setting
The main problem I have editing UserPreferencesMask in [HKEY_CURRENT_USER\Control Panel\Desktop] to 9F 3E 07 80 12 00 00 00 is when I right click a window or group of windows taskbar to close the menu immediately disappears. Anyone have a fix for this without additional software?
Windows implementation of this stinks. If you start to scroll before Windows has realized that you’ve moved the mouse over a new window, Windows hasn’t activated the new window, and the scroll event goes to the previously active window. Too slow!
unpaidbill’s regedit solution above is perfect, nice work. follow that and have a real xwindows focus, same like tweakui-xp! configurable to any delay you wish, I prefer a crisp almost instant 100ms.
totally agree this “ease of access” feature is worthless when it messes with z-order, really shows how out of touch ms is with proper ui design. why bother with it at all if it raises the window, to save a mouseclick??? it was probably designed only with disabled access in mind, but even then the clicking mechanic is needed either way, it’s pointless to combine.
I’m using unpaidbill’s registry tweak, but it’s still too slow. I want to happen instantly, like it does in X, or it did with the TweakUI fix in XP. Even with unpaidbill’s tweak it still takes a fraction of a second.