0

I want to disable the functionality of using a mouse when using a touch screen monitor in vb.net. The reason why I ask is because I want to limit users to only one option. is there a way I can code this in vb.net 2010.

BenMorel
  • 30,280
  • 40
  • 163
  • 285
Calvin
  • 603
  • 5
  • 15
  • 37
  • A touch screen just emulates a mouse click so that won't limit what they can click either. Are you sure you don't want to just change the mouse icon to something that can't be seen? – Matt Wilko Nov 29 '11 at 12:11
  • A programmer cannot compete with a pair of scissors. – Hans Passant Dec 28 '11 at 21:13

2 Answers2

1

I don't know of a purely .NET way, but you can execute devcon.exe to find classes of devices (USB HID Mice for example) and disable them.

http://support.microsoft.com/kb/311272

Edit: There is a similar question that shows a .NET example.

See also: http://www.codeproject.com/KB/cs/HardwareHelper.aspx

Community
  • 1
  • 1
Brad
  • 146,404
  • 44
  • 300
  • 476
-1

Just unplug the mouse.

If, for some reason, you can't do that, just disable it in Device Manager.

No code needed.

SLaks
  • 800,742
  • 167
  • 1,811
  • 1,896
  • Surely there's a way to disable a device programmatically? – Brad Nov 28 '11 at 22:10
  • @Brad: Yes, but I'm guessing he doesn't need it. Also, I don't know how to do that. :) – SLaks Nov 28 '11 at 22:11
  • Ha, I'm sure you're correct, but this doesn't really answer the question, does it? – Brad Nov 28 '11 at 22:14
  • just wanted to know, if i programmatically disable the mouse in the code, this wouldnt affect the way the touch screen monitor works right? – Calvin Nov 29 '11 at 01:30
  • @Calvin: That depends how you do it. If you disable the physical mouse device (a HID), the touch screen shouldn't be affected. – SLaks Nov 29 '11 at 01:35
  • @SLaks: can you point me to the right direction on how i can code this in vb.net? – Calvin Nov 29 '11 at 01:46