The Mouse class (MOUSE.CLS) contains information pertinent to (what else?) the mouse and its activities on the screen. Table 9.13 lists all the properties of the class, along with their datatypes and descriptions.
Table 9.13: Properties of the Mouse Class
Property | Read/Write? | Datatype | Description |
Buttons | No | Long | Retrieves the number of mouse buttons |
CursorOn | Yes | Boolean | Shows or hides the mouse cursor |
CursorX | No | Long | Retrieves the width, in pixels, of a cursor |
CursorY | No | Long | Retrieves the height, in pixels, of a cursor |
DoubleClickTime | No (write-only) | Long | Number of milliseconds between clicks, indicating to Windows that you’ve double-clicked. Normal value is around 450–500. To read double-click time, look in HKEY_CURRENT_USER\Control Panel\Mouse\DoubleClickSpeed |
DoubleClickX | Yes | Long | Width, in pixels, around the location of the first click in a double-click sequence. Second click must occur within the boundaries of this rectangle |
DoubleClickY | Yes | Long | Height, in pixels, around the location of the first click in a double-click sequence. Second click must occur within the boundaries of this rectangle |
DragX | Yes | Long | Width, in pixels, of a rectangle centered on a drag point to allow for limited movement of the mouse before the drag begins |
DragY | Yes | Long | Height, in pixels, of a rectangle entered on a drag point to allow for limited movement of the mouse before the drag begins |
MouseButtonSwap | Yes | Boolean | Sets or retrieves the swapped mouse button state (Button1 is on the right.) |
MousePresent | No | Boolean | Returns True if a mouse is installed |
MouseSpeed, MouseThreshold1, MouseThreshold2 | Yes | Long | MouseSpeed, combined with MouseThreshold1 and MouseThreshold2, creates the real mouse speed |
MouseTrails | Yes | Long | (Win95 only) Controls mouse trails. If the value is greater than 1, MouseTrails is on, and the higher the value, the more trails you get |
SnapToDefault | Yes | Boolean | (WinNT 4.x only) Determines whether the snap-to-default-button feature is enabled. If enabled, the mouse cursor automatically moves to the default button, such as “OK” or “Apply,” of a dialog box |
WheelPresent | No | Boolean | (WinNT 4.x only) Returns True if a wheel with a mouse is present |
WheelScrollLines | Yes | Boolean | (WinNT 4.x only) Determines the number of lines scrolled with each movement of the mouse wheel |
Even though the new wheeled mouse functions properly in Windows 95, there’s no support in that older operating system for determining whether the wheeled mouse is present or for controlling the number of lines to scroll when you move the wheel. Therefore, the WheelPresent and WheelScrollLines properties work properly only with Windows NT 4.x. On the other hand, Windows NT just doesn’t support the MouseTrails property, which Windows 95 does support.