#736 – 通过代码获取硬件支持的最大触摸点数(Finding the Maximum Number of Touch Points at Run-time)
来源:互联网 发布:win7怎么远程控制mac 编辑:程序博客网 时间:2024/05/20 06:04
原文地址;https://wpf.2000things.com/2013/01/17/736-finding-the-maximum-number-of-touch-points-at-run-time/
我们可以使用Win32的API函数GetSystemMetrics 获取硬件支持的最大触摸点数。
class Program{ [DllImport("user32.dll")] static extern int GetSystemMetrics(int nIndex); // Index passed in to GetSystemMetrics() indicates // what data we're asking for. private const int SM_DIGITIZER = 94; private const int SM_MAXIMUMTOUCHES = 95; // Masks used to check results from SM_DIGITIZER check private const int NID_READY = 0x80; private const int NID_MULTI_INPUT = 0x40; static void Main(string[] args) { string info; int digitizer = GetSystemMetrics(SM_DIGITIZER); if ((digitizer & (NID_READY + NID_MULTI_INPUT)) == NID_READY + NID_MULTI_INPUT) { int numTouchPoints = GetSystemMetrics(SM_MAXIMUMTOUCHES); info = string.Format("Multitouch ready, {0} inputs supported", numTouchPoints); } else info = "Multitouch not supported"; Console.WriteLine(info); Console.ReadLine(); }}
打印出结果如下:
你可以在“控制面板”->“系统”页中查看。
阅读全文
0 0
- #736 – 通过代码获取硬件支持的最大触摸点数(Finding the Maximum Number of Touch Points at Run-time)
- Finding the closest pair of points
- POJ 2699 The Maximum Number of Strong Kings(最大流)
- POJ 2699The Maximum Number of Strong Kings(最大流)
- POJ 2699 The Maximum Number of Strong Kings 最大流
- 平面最近点对 Finding the closest pair of points
- Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.
- 题目描述 Given n points on a 2D plane, find the maximum number of points that lie on the same straight
- Leetcode--->Given n points on a 2D plane, find the maximum number of points that lie on the same str
- The run time of Objective-C
- POJ 2699 The Maximum Number of Strong Kings(最大流)
- POJ 2699 The Maximum Number of Strong Kings 竞赛图+最大流
- [省选前题目整理][POJ 2699]The Maximum Number of Strong Kings(暴力枚举+最大流)
- POJ 2699 - The Maximum Number of Strong Kings(网络流‘最大流)
- POJ 2699 The Maximum Number of Strong Kings 最大流 枚举
- poj 2699 The Maximum Number of Strong Kings(最大流,建图)
- POJ 2699 The Maximum Number of Strong Kings(枚举+最大流)
- POJ 2699 The Maximum Number of Strong Kings(枚举/二分+最大流)
- php输出mysqli查询出来的结果
- 我自己做的网上项目目录
- vijos1441 打鼹鼠
- 证明:EXACT 4SAT is NP-complete
- iOS-关于MD5加密,AES加密,RSA加签验签
- #736 – 通过代码获取硬件支持的最大触摸点数(Finding the Maximum Number of Touch Points at Run-time)
- 如何把svn项目变成普通项目
- 5.4-全栈Java笔记:面向对象进阶之对象的转型 | FINAL关键字 |抽象方法和抽象类
- Python学习笔记【五】——《python基础教程》:: 条件、循环和其他语句
- DB2 的REORG_学习(3)_索引重组
- framework7---framework7下关于导航栏和工具栏的几种布局类型
- 硅谷游记|机智云硅谷行第二季完美收官
- 出现“There is a cycle in the hierarchy”异常
- ajax