LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Can InstallWinMsgCallback receive joystick notifications?

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);

 

0 Kudos
Message 1 of 4
(3,208 Views)

What is returned into result after calling joySetCapture? Also, did you call joyReleaseCapture before joySetCapture to release it from other windows?

National Instruments
0 Kudos
Message 2 of 4
(3,201 Views)
It returns zero - JOYERR_NOERROR. The code for InstallWinMsgCallback is InstallWinMsgCallback(panelHandle, MM_JOY1MOVE, joystick_callback, VAL_MODE_IN_QUEUE, NULL, &post_handle); Does InstallWinMsgCallback handle multimedia extension window messages? I can read all the joystick movement and buttons using joyGetPosEx but I could not get the CVI to receive the joystick message. rgds
0 Kudos
Message 3 of 4
(3,198 Views)

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.

National Instruments
0 Kudos
Message 4 of 4
(3,182 Views)