Reputation: 1377
I'm using this C#(wpf) code to detect touch screen on
return Tablet.TabletDevices.OfType<TabletDevice>().Any(dev => dev.Type == TabletDeviceType.Touch)
But it is not working. Tablet.TabletDevices Count is always 0. I'm using extension touch monitor(use USB connect PC for touch detect)
Is there any better way to check if current PC has touch screen or not?
Thanks.
Update1:
I don't know why but even when I remove the touch screen USB and monitor,
GetSystemMetrics(SM_MAXIMUMTOUCHES)
still returns 1.Update2:
looks like that is not working, I mean use :
return GetSystemMetrics(SM_MAXIMUMTOUCHES) > 0
Because it's always returning 1, even when I restart computer(win7 OS, laptop computer)
Upvotes: 2
Views: 3437