-1

I have perhaps a silly question, but I am curious to find out if, you can code a program, for instance in c++, which would disable or enable touch screen without rebooting or signing out, in addition I just want to disable touchscreen and be still able to use pen on tablet. (on windows 10).

I know you can enable or disable touch screen by Device manager, but that is not what I am looking for. Also I know that you can tweak registries to disable/enable the touchscreen, but it only takes effect if one reboots or signs out.

I would just want to know if there is a way to do this. Is there any function for this in .net framework or win32? Thank you for any answer.

kuna365
  • 13
  • 4

1 Answers1

1

If you want to quickly enable and disable the touch screen, DevCon.exe is a good option.

DevCon (DevCon.exe) is a command line tool that can display detailed information about devices on computers running Windows. You can also use DevCon to enable, disable, install, configure, and remove devices.

You can use DevCon to create shortcut that can be quickly enabled and disabled.

DevCon Enable:

devcon [/r] enable {* | ID [ID ...] | =class [ID [ID ...]]}

DevCon Disable:

devcon [/r] disable {* | ID [ID ...] | =class [ID [ID ...]]}

Get the hardware ID, for example, HID\VID_####&PID_####&COL##

Then create a Batch File

set "touchscreenid=ID_HERE"
devcon status "%touchscreenid%" | findstr "running"
if %errorlevel% == 0 (
    devcon disable "%touchscreenid%"
) else (
    devcon enable "%touchscreenid%"
)

Finally, change the properties of the file to make it a shortcut.

For details, you can refer warrenj203's answer.

Hope to help you.

Strive Sun
  • 4,935
  • 1
  • 4
  • 19