WM_TOUCH vs WM_POINTER

橙三吉。 提交于 2019-12-19 10:19:25

问题


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?


回答1:


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

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.



来源:https://stackoverflow.com/questions/23790602/wm-touch-vs-wm-pointer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!