Hello,
I have a question about handling Windows messages.
In particular I need to handle WM_TOUCH messages on Windows 7 from within Unity (see note on TUIO later).
In a Windows forms application, for instance, I would override WndProc and handle the message there.
In a Win32 (e.g. directx) application, I would implement a Message handler and use PeekMessage to get each message - farming off WM_TOUCH to a specific method to handle the decoding.
However (I believe) neither option is available to me in Unity3d since this stuff is, rightly, hidden away from developers.
So what I have done so far to try to get this working is to implement a message snooper method in an external DLL, which gets called regularly (e.g. in Update()). This peeks windows messages from the Hwnd of the Unity game window.
I can successfully trap WM_TOUCH messages in this way, and am farming them off to my decode method. Now here's the problem - the LPARAM is an invalid handle for these messages. I believe this is because the Unity message loop has already processed them with DispatchMessage. (see link text).
Therefore this approach has come to a dead end.
What I really want to be able to do is write some code in the Unity message loops to handle my WM_TOUCH messages.
Does anyone have any suggestions on how I can get this to work, or if there'll be anything in Unity 3 that will help me?
NB: I would maybe like to use TUIO, but I'm yet to find a TUIO source for Windows7 multitouch that will work in full screen mode with no user configuration. I've tried W2TUIO but am not having much luck with it.
Any information/help will be gratefully received.
Thanks, Andrew