set a mouse speed with button

programicks

New member
Joined
Mar 31, 2010
Messages
3
Programming Experience
1-3
I would like to be able to simply set a mouse speed with a button.

I have successfully got the following to change the registry but although the registry shows the change, the mouse cursor speed remains the same after checking regedit.

'Open Registry Key
'Dim NewKey As RegistryKey
'NewKey = Registry.CurrentUser.OpenSubKey("Control Panel\Mouse", True)

'Dim SetVal As String
'NewKey.SetValue("MouseSensitivity", 2, RegistryValueKind.String)
'NewKey.Close()

Maybe there is a way to control with the API, but I can only find controlling API using visual basic 6 rather than .net

I am using Visual basic 2008 Express edition.

Any help is appreciated

Michael
 
SystemParametersInfo Function (Windows)
VB.NET:
Declare Function SystemParametersInfo Lib "user32.dll" Alias "SystemParametersInfoA" _
                (ByVal uAction As Int32, ByVal uParam As Int32, ByVal lpvParam As Int32, ByVal fuWinIni As Int32) As Int32
Const SPI_SETMOUSESPEED As Int32 = 113
Const SPIF_UPDATEINIFILE As Int32 = &H1
VB.NET:
SystemParametersInfo(SPI_SETMOUSESPEED, 0, 20, SPIF_UPDATEINIFILE)
progamicks said:
I am using Visual basic 2008 Express edition.
You should update your forum profile, it currently says your using .Net 1.0 (VB 2002).
 
Thanks for your reply, I will be checking your code later. Sorry about the profile, also, I didn't put 'question' before my title so will do that on another post :)
 
Back
Top