1

これらの MAKEINTRESOURCE 、 GetClassLong 、 LOWORD((LPSTR)cursor_name) 、および LoadCursor のうち、いずれかが 64 ビットに対応していませんか? そうでない場合、解決策は何ですか、私のコードは32ビットでは正常に機能しますが、64ビットでは機能しません。コードは巨大なアプリケーションであり、使用される主な関数は上にリストされています...関数にはパラメーターmouse_formがあります

  HCURSOR c_cursor, n_cursor;
  LPSTR cursor_name;

    switch( mouse_form )
    {
            case MOUSE_WIN_ARROW:
                    cursor_name = (LPSTR)IDC_ARROW;
                    break;

            case MOUSE_ARROW:
                    cursor_name = (LPSTR)IDC_ARROW;

                         #if (!(defined WIN32) && !(defined WIN64))


        if( environ_get_window_id() != -1 ) cursor_name = (LPSTR)IDCC_ELXHND;

    #endif
                    break;

            case MOUSE_CURSOR:
                    cursor_name = (LPSTR)IDC_IBEAM;
                    break;

            case MOUSE_HOURGLASS:
                    cursor_name = (LPSTR)IDC_WAIT;
                    break;

            case MOUSE_POINTING_HAND:

                        #if ((defined WIN32) || (defined WIN64))
                                cursor_name = (LPSTR)IDC_ARROW;
                        #else

                cursor_name = (LPSTR)IDCC_ELXHND;
                        #endif



                    break;

            case MOUSE_OPEN_HAND:
                    cursor_name = (LPSTR)IDC_ARROW;
                    break;

            case MOUSE_THIN_CROSS:
                    cursor_name = (LPSTR)IDC_CROSS;
                    break;

            case MOUSE_THICK_CROSS:
                    cursor_name = (LPSTR)IDC_CROSS;
                    break;

            case MOUSE_OUTLINED_CROSS:
                    cursor_name = (LPSTR)IDC_SIZE;
                    break;

            case MOUSE_MENU_ARROW:
                    cursor_name = (LPSTR)IDCC_ELXMEN;
                    break;

            default:
                    cursor_name=(LPSTR)MAKEINTRESOURCE( mouse_form );
    }

    n_cursor = environ_wload_cursor( cursor_name );

     #if ((defined WIN32) || (defined WIN64))

    if( environ_control->w_param) 
        c_cursor = (HCURSOR)GetClassLong( environ_control->w_param->awindow,(ELX_LONG) GCLP_HCURSOR );
    else
    c_cursor = (HCURSOR)GetWindowLong( GetForegroundWindow(),(ELX_LONG) GCLP_HCURSOR ); 

    #else
    c_cursor = GetClassWord( environ_control->w_param->awindow, GCW_HCURSOR );
    #endif

    #if ((defined WIN32) || (defined WIN64))

    if( environ_control->w_param) 
    {
    #endif
        if( !n_cursor )
        {
            if( environ_control->win_cptr->window_id == -1 )
            {
            n_cursor = ewcore_control.orig_cclient;
            }
            else
            {
            n_cursor = ewcore_control.orig_cchild;
            }
        }
        else environ_control->win_cptr->prev_cursor = c_cursor;
    #if ((defined WIN32) || (defined WIN64))
    }
        else
    {
        if( !n_cursor )
        {
            n_cursor = ewcore_control.orig_cclient;     
        }
        //else 
        //environ_control->win_cptr->prev_cursor = c_cursor;

    }
    #endif
    #if ((defined WIN32) || (defined WIN64))

    if(environ_control->w_param)
        SetClassLong( environ_control->w_param->awindow, GCLP_HCURSOR,(ELX_LONG)n_cursor );
    else
        SetWindowLong( GetForegroundWindow(), GCLP_HCURSOR, (ELX_LONG)n_cursor );

    #else
    SetClassWord( environ_control->w_param->awindow,GCW_HCURSOR, n_cursor );
    #endif
    SetCursor( n_cursor );
}
4

1 に答える 1