Link to home
Start Free TrialLog in
Avatar of jamesbrown
jamesbrown

asked on

Toggling Xmouse on Windows NT 4.0

I am trying activate/deactivate XMouse on a Windows NT machine (similar to the XMouse check box in TweakUI).  I have found the registry key ("HKEY_CURRENT_USER\Control Panel\Mouse\ActiveWindowTracking") and I can change the value there of.  

But, I cannot force the necessary refresh to activate/deactivate XMouse.  But, after logging out and logging back in, XMouse is set as expected.

So, is there an API call to force the refresh?  (Note: I have tried :
::SendMessage (HWND_BROADCAST, WM_SETTINGCHANGE, NULL, NULL);
which does not seem to work.

Do I have to "restart" the mouse device?  If so, how?

Any help would be greatly appreciated.

Cheers,JB.
Avatar of fwilkinson
fwilkinson

SystemParametersInfo() claims to do this for NT 5.0, but you might want to try it just in case.

SHChangeNotify() might be a way of kicking the shell into noticing the change you made to the registry, without having to reboot.  Have you read the documentation for this function?


I forgot to mention this before, but TweakUI uses both the functions I listed.
Avatar of jamesbrown

ASKER

I have looked at the parameters that are available for use in SHChangeNotify() and SystemParametersInfo() and none of them even hint at anything close to performing what I need done.  If you know of an undocumented parameter, please let me know.

JB
What version of the documentation are you reading?

I just spent some time hacking about, and I have the answer you want.  It took me a couple of hours though, so do you think you could raise the value of this question?  it would make me feel better about spending my time this way.


I took a look at the documentation - not exactly sure what version.  I did however have a look through the MSDN site and found that in NT 5 SystemParametersInfo() has SPI_GETACTIVEWINDOWTRACKING and SPI_SETACTIVEWINDOWTRACKING.  But I need this for NT 4.  I looked all over for the #define's for these but could not find them.  I hope your solution works for NT 4.

JB
ASKER CERTIFIED SOLUTION
Avatar of fwilkinson
fwilkinson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you.  I looked and loked and did not find.

JB