Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: VB5,VB6,Win98,Win2K
Expertise: Intermediate
Nov 11, 2000

Control the mouse speed under Windows 98 / 2000

Under Windows 98 and 2000 you can control the speed of the mouse. The mouse speed determines how far the pointer will move based on the distance the mouse moves. The pvParam parameter must point to an integer that receives a value which ranges between 1 (slowest) and 20 (fastest). A value of 10 is the default. The value can be set by an end user using the mouse control panel application or by an application using the SystemParameterInfo API function:

Private Declare Function SystemParametersInfo Lib "user32" Alias _
    "SystemParametersInfoA" (ByVal uAction As Long, ByVal uParam As Long, _
    ByRef lpvParam As Any, ByVal fuWinIni As Long) As Long
Const SPI_SETMOUSESPEED = 113
Const SPI_GETMOUSESPEED = 112

' modify the mouse speed to make it as fast as possible
Dim Speed As Long
Speed = 20
SystemParametersInfo SPI_SETMOUSESPEED, 0, ByVal Speed, 0
You can retrieve the current mouse speed (so that you can later restore it) using the SPI_GETMOUSESPEED value for the first argument to SystemParameterInfo:

Dim Speed As Long
' note that Speed is passed ByRef
SystemParametersInfo SPI_SETMOUSESPEED, 0, Speed, 0
Print "Mouse speed = " & Speed
Francesco Balena
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date