7

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?

0

2 Answers 2

6

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.

4
  • 1
    But WM_TOUCH returns an array of touch events with the subsequent GetTouchInputInfo(), whereas WM_POINTER* means a separate message for each touch event with associated window procedure call. Isn't the latter less efficient in a multi-touch situation? May 23, 2014 at 22:16
  • 3
    @DisplayName You're doing it wrong. :) Look at GetPointerFrameInfo to retrieve an entire set of touch messages at once. If you're the only pointer handler, you can use SkipPointerFrameMessages to discard the remaining pointer messages for the frame.
    – Eric Brown
    May 23, 2014 at 22:57
  • What is WM_POINTER? All I found on MSDN is a series of message ids like 'WM_POINTERACTIVATE', 'WM_POINTERUPDATE' etc, are they what this thread is about? May 29, 2018 at 23:54
  • @TimLovell-Smith Yes.
    – Eric Brown
    May 30, 2018 at 16:38
0

I know this is responding to a very old question but someone else might find it useful: I wanted the simplified correlation of touch screen X,Y coordinate to screen coordinate provided by WM_TOUCH but needed the native accuracy of the touch digitizer, not the screen coordinates that fairly closely resemble the digitizer data (which is all that are available from WM_TOUCH). I needed this full resolution data for testing a touch screen to spec. You can get the low level coords using raw input, but registering for raw input stops WM_TOUCH messages. So as others stated above, I tried using WM_POINTERxxxxx messages and found that registering for raw HID data does not disable WM_POINTER messages. Problem solved.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.