检测平板电脑 [英] Detecting tablet PC

查看:115
本文介绍了检测平板电脑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.net winforms应用程序,某些用户将在Win7平板电脑上运行。对于这些用户,我想更改某些UI元素以简化笔输入,同时将这些项目留给普通用户使用。我已经找到有关Pen& Pen设计指南的msdn文档。触摸,以及在电子墨水等上的坚韧不拔,但仅检测到此机器是否支持手写笔或触摸就什么也没有。有任何提示吗?

I have a .net winforms application which some users will run on Win7 tablets. For those users, I want to change certain UI elements to make pen input easier, while leaving those items alone for regular users. I've been able to find msdn docs on design guidelines for pen & touch, and nitty gritty on e-ink and such, but nothing on just detecting "Does this machine support a stylus or touch". Any hints?

推荐答案

A。使用Windows GetSystemMetricsAPI并传入SM_TABLETPC作为索引值。在Winuser.h中定义了SM_TABLETPC。 SM_TABLETPC的值为86。

A. Use the Windows GetSystemMetricsAPI and pass in SM_TABLETPC as the value of the index. SM_TABLETPC is defined in Winuser.h. The value of SM_TABLETPC is 86.

对于Web开发,您应该阅读USER_AGENT_STRING环境变量。您可以访问此Request.ServerVariables集合。

For web development, you should read the USER_AGENT_STRING environment variable. You can access this Request.ServerVariables collection.

有关如何在运行Windows Vista或Windows XP Tablet PC Edition的Tablet PC上使用GetSystemMetrics的详细信息,请参阅确定是否PC是平板电脑。

For details of how to use GetSystemMetrics on Tablet PCs running either Windows Vista or Windows XP Tablet PC Edition, refer to Determining Whether a PC is a Tablet PC.

来源

确定PC是否为平板电脑

MSDN Windows平板电脑-常见问题

这篇关于检测平板电脑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆