WM_TOUCH和WM_POINTER [英] WM_TOUCH vs WM_POINTER

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

问题描述

我应该使用哪个?我只使用Windows 8.x,所以我不在乎WM_POINTER与Windows 7等不向后兼容.仅关于原始的接触. WM_POINTER的唯一明显优势似乎是它可以统一触摸和鼠标输入(但是使用WM_TOUCH很容易解决,因为可以使用GetMessageExtraInfo()检查鼠标事件).易于使用也不是问题.我已经在使用WM_TOUCH了,我只是想知道是否应该切换到WM_POINTER.我最关心的是延迟和效率(与游戏相关的应用程序).我无法确定WM_POINTER是否是WM_TOUCH的包装,这有额外的开销.有任何评论吗?

Which one should I use? I'm only using Windows 8.x, so I don't care about the fact that WM_POINTER is not backwards compatible with Windows 7 etc. I also don't care about gestures; only about raw touches. WM_POINTER's only clear advantage seems to be that it unifies touch and mouse input (but that's easy to work around with WM_TOUCH because mouse events can be checked with GetMessageExtraInfo()). Ease of use is also not an issue; I've been using WM_TOUCH already and I'm just wondering if I should switch to WM_POINTER. My overriding concern is latency and efficiency (game-related application). I can't tell whether WM_POINTER is a wrapper over WM_TOUCH that has extra overhead. Any comments?

推荐答案

WM_TOUCH已过时.只能使用WM_POINTER. (WM_TOUCH实际上是WM_POINTER的包装.)

WM_TOUCH is obsolete. Use WM_POINTER exclusively. (WM_TOUCH is actually a wrapper over WM_POINTER.)

GetMessageExtraInfo也非常脆弱.您必须在调用GetMessage之后立即调用.否则,您将冒着中间函数调用进行COM调用或其他导致调用GetMessage的危险.

GetMessageExtraInfo is also notoriously fragile. You have to call it immediately after calling GetMessage, or else you run the risk of intermediate function calls making a COM call or doing something else that results in calling GetMessage.

这篇关于WM_TOUCH和WM_POINTER的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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