Swap Mouse Button
1.Button - Fix it
2.Button - Swap
Code:
Public Class Form1
Private Declare Function SwapMouseButton Lib "user32" Alias "SwapMouseButton" (ByVal bSwap As Long) As Long
Private Const MB_DEFBUTTON1 As Long = &H0&
Private Const MB_DEFBUTTON2 As Long = &H100&
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SwapMouseButton(MB_DEFBUTTON1)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
SwapMouseButton(MB_DEFBUTTON2)
End Sub
End Class
Caps Lock
1.Button - Turn ON Caps Lock
2.Button - Turn OFF Caps Lock
Code:
Imports System.Runtime.InteropServices
Public Class Form1
<DllImport("user32.dll", CallingConvention:=CallingConvention.StdCall, _
CharSet:=CharSet.Unicode, EntryPoint:="keybd_event", _
ExactSpelling:=True, SetLastError:=True)> _
Private Shared Function keybd_event(ByVal bVk As Int32, ByVal bScan As Int32, _
ByVal dwFlags As Int32, ByVal dwExtraInfo As Int32) As Boolean
End Function
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Unicode)> _
Private Shared Function GetKeyState(ByVal nVirtKey As Integer) As Short
End Function
Sub SetCapsLockKey(ByVal newState As Boolean)
If CBool(GetKeyState(Keys.CapsLock)) <> newState Then
keybd_event(Keys.CapsLock, 0, 0, 0)
keybd_event(Keys.CapsLock, 0, &H2, 0)
End If
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
SetCapsLockKey(True)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
SetCapsLockKey(False)
End Sub
End Class
Crazy Mouse
1.Timer
2.Button - Start
Code:
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Timer1.Start()
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
Dim random As New Random
System.Windows.Forms.Cursor.Position = New System.Drawing.Point(random.Next(0, 1000), random.Next(0, 1200))
End Sub
End Class
Disable Mouse/Keyboard
1.Button - Disable
2.Button - Enable
Code:
Public Declare Function apiBlockInput Lib "user32" Alias "BlockInput" (ByVal fBlock As Integer) As Integer
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
apiBlockInput(0)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
apiBlockInput(1)
End Sub
USB Write
1.Button - Block
2.Button - Unblock
Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies", "WriteProtect", "00000001", Microsoft.Win32.RegistryValueKind.DWord)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
My.Computer.Registry.SetValue("HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies", "WriteProtect", "00000000", Microsoft.Win32.RegistryValueKind.DWord)
End Sub
Credit to 007HackerBoy