10-18-2011 02:52 AM
Hi,
I had tried to use the InstallWinMsgCallback to capture joystick events.
However, the routine does not seem to work. I had tested the above routine using WM_KEYUP and it works.
Any possible reasons?
I use the following code to channel the joystick messages to CVI.
main_panel = GetCVIWindowHandle();
result = joySetCapture((HWND)main_panel, JOYSTICKID1,10 FALSE);
10-18-2011 05:27 PM
What is returned into result after calling joySetCapture? Also, did you call joyReleaseCapture before joySetCapture to release it from other windows?
10-18-2011 10:34 PM
10-21-2011 02:57 PM
I believe this should work in CVI, but I don't have a joystick to test this on. I found a CVI instrument driver for joysticks that could make a good example (or you could use the instrument driver itself). In particular, the JoyWndProc function in joystick.c is handling the messages you mentioned.