Curiosity killed the cat, meaning: being too curious can be dangerous. Why am I mentioning this? Well, I’m a curious person, I always want to know what makes something tick; in today’s lesson, you will say that I wanted to know what goes on behind the scenes when changing Mouse settings, how is it done, where are these settings? Those are just a few questions I will answer today. I will show you how to change all the Mouse settings through the use of your Visual Basic program and the Registry.
Highlights include:
- Changing Mouse Wheel settings
- Swap the Mouse buttons (Right handed/ Left Handed)
- Change double-click speed
- Click Lock
- Mouse Pointer Trails
- Mouse Pointer Shadows
- Snap to default button
- Hide the cursor while typing
- Mouse Pointer speed
Basically, all the settings are found in the Mouse control panel applet.
The Design
I have designed my form to look like Figure 1. Feel free to give all objects your own descriptive names.
Figure 1: Design
The Coding
All the Mouse settings are stored in two main Registry keys:
- HKEY_CURRENT_USER\Control Panel\Desktop
- HKEY_CURRENT_USER\Control Panel\Mouse
To obtain these settings and to change them, you need to Import the Microsoft.Win32 namespace so that you can get access to all its Registry functions. You’ll start with the Mouse Wheel Scroll settings.