Joystick programming question using MFC

Hi! I am working on a joystick test program using MFC. I know Windows platform includes some multimedia extension Windows messages (not standard windows messages) like MM_JOY1BUTTONDOWN to handle Multimedia devices.  When I am
trying to press any button of the joystick so that Windows will notify my program that one of its buttons has change states, it does NOT WORK if I use ON_MESSAGE(MM_JOY1BUTTONDOWN , OnJoyButtonDown) to handle MM_JOY1BUTTONDOWN message.
(Note: OnJoyButtonDown is a user-defined message function)

Could you tell me the correct way to solve my problem ASAP?

Who is Participating?
chensuConnect With a Mentor Commented:
You should use the joySetCature function first to capture the joystick so that its messages will be sent to the specified window.

jennyhouAuthor Commented:
Edited text of question
jennyhouAuthor Commented:
Thanks for your help about my question!
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.