[win32] - about joystick

i activate the joystick with some search:
1
2
3
4
5
6
7
8
9
10
11
12
switch(msg)
            {
                case WM_NCCREATE:
                {
                    CREATESTRUCT *p = (CREATESTRUCT *)lParam;
                    inst = (form *)p->lpCreateParams;
                    SetWindowLongPtr(HandleWindow, GWLP_USERDATA, (LONG_PTR)inst);
                    inst->hwnd = HandleWindow;
                    joySetCapture(inst->hWnd(),JOYSTICKID1,100,true);

                }
                break;

inst is the class instance pointer.
but i see 1 problems:
1 - i activate the 1st joystick(JOYSTICKID1). but imagine that i want activate more.. how can i do it?
2 - if the joystick messages are: MM_JOY2BUTTONDOWN(up and move) and MM_JOY1BUTTONDOWN(up and move)... how can i get the messages for other joysticks?
3 - how can i get the number of connected joysticks?
Last edited on
Topic archived. No new replies allowed.