SwapMouseButton Reference in C#, VB.NET and VB6
Visual Basic 6 definition
Visual Basic 6 example source code
Declare Function SwapMouseButton Lib "user32.dll" (ByVal bSwap As Long) As Long
Visual Basic .NET definition
Declare Function SwapMouseButton Lib "user32" (ByVal bSwap As Integer) As Integer
public static extern int SwapMouseButton(int bSwap)
Platforms: Win 32s, Win 95/98, Win NT
SwapMouseButton alters the mapping used for the mouse buttons. Windows allows you to interpret left-button clicks as right-button clicks and vice versa. This functionality is designed for people who use the mouse left-handed. Of course, Windows is normally the only program to ever change this, so do it with caution -- it of course affects mouse usage in all programs as well as Windows itself. The function returns 1 if successful, or 0 if an error occured.
For further information on Windows API functions such as these, and how to use these API's in your
C# and VB.NET applications, please refer to the book 'Network programming in .NET' (Buy at Amazon UK)
(Buy at Amazon US)
C# example source code
Provide a code example
Copyright 2017 Infinite Loop Ltd.