Reputation: 361
I created a DLL in Visual Studiio 2013 which works with the manipulation-event and outputs refined translation, rotation and scaling. Afterwards I tried to merge this with a OpenGL-Project, to provide proper gesture support.
The DLL is build with .NET 4.0 Client Profile selected, and I tested it with a simple implementation in VS2013. Everything worked flawless and the setup was pretty easy.
Now the OpenGL Project is being maintained and developed in VS2010, so I fired up VS2010, referenced my DLL and did an override on the WndProc to get the WM_POINTER* events into my DLL.
The problem is that I do not get the events ! I not once managed to receive a WM_POINTER* event.
I have some ideas:
Development machine is Win 7, test machine is Win 8 - maybe some WIN8 Features are required at build time ?
I simply can't work with Win8 API in VS2010, even if I only use a DLL generated in VS2013
Windows somehow determines that I do not want WM_POINTER* events as I run a Application not explicitly developed for Windows 8 (Not sure how I could change that)
I've already tested various versions of the .NET Framework, so it's not a .NET issue. I furthermore verified that no WM_POINTER* events are fired for this particular application (in any other it works just fine) and that my WndProc override is working properly.
I am pretty desperate and have no real clue what else to try.
Would be really glad if anyone with WIN8 Pointer experience could help me out.
Cheers !
Edit: Forgot to mention that the OpenGL-Project is basically a WinForms Application.
Upvotes: 2
Views: 1391
Reputation: 89
In my case, I wasn't receiving WM_Pointer events from my Wacom tablet because I had to enable windows ink in my tablet settings... You can test this by going to some drawing application like photoshop and seeing if pen pressure works, if it doesn't then it probably isn't your application's fault that you're not receiving WM_POINTER messages!
And if you want the mouse to generate pointer events you have to call EnableMouseInPointer(true)
Upvotes: 0
Reputation: 361
For anyone stumbling about this:
Reddit-User darinitis wrote this
Did you have an OpenGL window in VS2013, or was the test just to capture gestures in a winforms project?
OpenGL may be creating a window in front of, or as a child of your winforms window. Because the pointer is never actually over your window (it is on the GL one), you don't get the pointer messages.
Have you used Spy++ to see the actual window hierarchy and see if another window is being created for OpenGL above your window?
And was right on spot. The OpenGL child I had did not forward the events but tried to handle them. This way nothing ever arrived in my WinForms application.
Upvotes: 1
Reputation: 813
WM_POINTER messages were introduced in Windows 8, and that's why it doesn't work in your development machine. You will need to resort to the old, deprecated WM_TOUCH and WM_GESTURE messages: http://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/b8cb28dd-b2ba-4392-b3a8-6bf18518087f/windows-8-wmpointer-vs-wmtouch?forum=tabletandtouch
Upvotes: 1