|
Control the mouse speed under Windows 98 / 2000
|
Total Hit (3614) |
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 t
....Read More |
Rating
|
|
|
Correctly restore mouse cursor
|
Total Hit (3403) |
When you write lengthy procedures, it is a good habit to change the mouse cursor to an hourglass, and restore it to the original shape when the procedure exits. However, this cursor tracking may be rather difficult when the procedure has multiple exit points, or when it can exit abruptly because of
....Read More |
Rating
|
|
|
Determine the number of mouse buttons
|
Total Hit (3224) |
Sometimes is useful to know how many buttons the user's mouse has. This value can be obtained by calling GetSystemMetrics. The constant to pass as parameter is SM_ CMOUSEBUTTONS. Here's an example:
«Code LangId=1»
Const SM_CMOUSEBUTTONS = 43
Private Declare Function GetSystemMetrics Lib "user3
....Read More |
Rating
|
|
|
Hide and show the mouse cursor
|
Total Hit (3233) |
At times you may want to temporarily hide the mouse cursor, for example in order to reduce flickering. To do so you just need the ShowCursor API function:
«Code LangId=1»
Private Declare Function ShowCursor Lib "user32" (ByVal bShow As Long) As Long
' hide the mouse
ShowCursor False
' do
....Read More |
Rating
|
|
|
Intercepting MouseEnter and MouseExit events without subclassing
|
Total Hit (4023) |
Visual Basic raises the MouseMove event when the mouse cursor is within a control, so it's easy to know when the cursor "enters" a control. However, determining when the mouse leaves the control is more difficult.
You can solve this problem by monitoring the first time the control raises the Mous
....Read More |
Rating
|
|
|
Swap the mouse buttons' behavior and meaning
|
Total Hit (4153) |
You can programmatically swap the meaning of the left and right mouse buttons, to account for your left-handed users. All you need is a call to the SystemParameterInfo API function
«Code LangId=1»
Private Declare Function SystemParametersInfo Lib "user32" Alias _
"SystemParametersInfoA" (By
....Read More |
Rating
|
|
|
The status of mouse buttons
|
Total Hit (3397) |
Visual Basic lets you test the state of mouse buttons only inside a MouseDown, MouseMove, or MouseUp event procedure. To determine the current state of mouse buttons you can use one of the following functions:
«Code LangId=1»
Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vKey As
....Read More |
Rating
|
|
|
The status of shift keys
|
Total Hit (2952) |
Visual Basic lets you test the state of the Shift, Alt and Ctrl keys only within the KeyUp, KeyDown and all the mouse-related event procedures. If you want to test the state of these keys from within another routine, you can resort to the following functions:
«Code LangId=1»
Private Declare Fun
....Read More |
Rating
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|