Hi all,
I'm currently trying to integrate a SpaceNavigator 3D mouse in a NI Labwindows application for controlling a robot. Labwindows is an IDE using Ansi C as programming language.
So far, I've been able to handle the 3D mouse events trough the Windows messaging system (almost just as it is done in the 3DxTest.c demo that comes with the SDK).
The difference is that I can not go as deep as in 3DxTest in the message handling, since labwindows manages and handles Windows messages quite a lot, as indicated here:
http://digital.ni.com/public.nsf/allkb/ ... EF00839871
So I use a routine that intercepts only certain windows message, and the message must be given by its number. I made a small test to catch the 3Dx message number, and hardcode this number in the main program, and every thing works like a charm. So nice...
But the problem is that the message number delivered by the 3Dx devices seems to be varying... It depends on the session you're logged on, on the computer, etc... For instance, 3Dx devices message numbers are 49647 and 49486 on two different windows sessions...
So is there a simple way to get this windows message number programmatically during the 3Dx initialisation, or is there a workaraound that I may use...
Thanks a lot for any help.
François
P.S. I use Windows XP SP3 (32 bits)
SpaceNavigator in NI Labwindows : Windows message number ?
Moderator: Moderators
Hi Jim,
Thanks for the quick reply and for the hint.
I looked in the SDK doc, but missed this point as I don't use MFC
Anyway, it now works !
A simple call to RegisterWindowMessage("SpaceWareMessage00") after 3D mouse initialisation gives me the message number.
I haven't seen many LabWindows users 'round here, but if it may help, I will post here a code skeleton that I use to handle 3D mouses in LabWindows.
Many thanks again ! That's a great user support
François
Thanks for the quick reply and for the hint.
I looked in the SDK doc, but missed this point as I don't use MFC
Anyway, it now works !
A simple call to RegisterWindowMessage("SpaceWareMessage00") after 3D mouse initialisation gives me the message number.
I haven't seen many LabWindows users 'round here, but if it may help, I will post here a code skeleton that I use to handle 3D mouses in LabWindows.
Many thanks again ! That's a great user support
François