title: How to disable mouse using Visual Basic
body: <p>I wrote a tech toolbox in autohotkey but a lot of AV software has been starting to kill things written in autohotkey so I am redoing it in VB .net 
  I have been able to get most everything done but one of the tools that almost everyone that uses my toolbox uses is a hotkey that disables the mouse. We are working remotely using logmein and it just stops the customers from killing things like virus removal tools.</p>
  
  <p>I have found a way to disable both mouse and keyboard using VB.net but it disables it completely instead of just for the customer, and I just want it to disable the mouse not the keyboard too because when it kills both the hotkey to enable them again does not work lol.</p>
  
  <p>Here is what I have been using for code.</p>
  
  <pre><code>Private Declare Function GetAsyncKeyState Lib "user32" (ByVal vkey As Long) As Integer
  Private Declare Function BlockInput Lib "user32" Alias "BlockInput" (ByVal fBlock As Integer) As Integer
  Private Declare Function ShowCursor Lib "user32" (ByVal lShow As Long) As Long
  Private Sub Timer1_Tick(sender As Object, e As EventArgs) Handles Timer1.Tick
      Timer1.Enabled = True
      Timer1.Interval = 1
      Dim mkey As Boolean
      Dim dkey As Boolean
      Dim ekey As Boolean
      mkey = GetAsyncKeyState(Keys.M)
      dkey = GetAsyncKeyState(Keys.D)
      ekey = GetAsyncKeyState(Keys.E)
      If mkey And dkey = True Then
          BlockInput(1)
          ShowCursor(0)
      End If
  
      If mkey And ekey = True Then
          BlockInput(0)
          ShowCursor(1)
      End If
  End Sub
  </code></pre>