The easy way would be to use the "legacy" (Windows 7) API. With this, you receive the touch input as a WM_TOUCH
message.
You use the lParam of that message in a call to GetTouchInputInfo
.
That returns an array of TOUCHINPUT
structures, each of which includes an x
and y
coordinate (which, in what seems like it may be a record for useless/illusory precision, is given to a precision of a one-hundredth of a pixel).
For new apps, Microsoft recommends using the Pointer Input API. With this, you'd receive messages like WM_POINTERDOWN
, WM_POINTERUP
, and WM_POINTERUPDATE
. With these, the lParam of the message contains a single x/y point for the input. For more complete information about the location, you'd call GetPointerInfo
to retrieve the coordinates of the input in POINTER_INFO
structures.