For quite some time, Windows has had a setting officially called active window tracking but which informally goes by the name X-Mouse, because that was the name of the PowerToy which first exposed the feature. (The PowerToy was in turn so-named because it made the mouse behave in a manner similar to many X window managers.) The setting is exposed to end users in Windows 7 on Make the mouse easier to use under Activate a window by hovering over it with the mouse.
If you want to write your own PowerToy to control this setting, you can do so by calling the
SystemParametersInfo function. There are three settings which collectively control the X-Mouse feature:
SPI_SETACTIVEWINDOWTRACKING: This is the master switch which enables the behavior.
SPI_SETACTIVEWNDTRKZORDER: This controls whether the window is brought to the top when it is activated by active window tracking.
SPI_SETACTIVEWNDTRKTIMEOUT: This controls how long the mouse has to be in a window before it is auto-activated.
Note that X-Mouse is a user preference. Applications should not change the setting without the user's permission.