从这些 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 );
}