怎样才能改变光标? 问:我开发了一个小的应用程序,其中我想将光标改变为一个用户定义的光标,转换 是 由用户通过菜单来选择的,为了达到这个目的,我采用了如下步骤1.在 PreCreateWindow 中定义了一个hCursor成员变量,并置为空 2.程序的菜单对应函 数中,我调用LoadCursor() 和SetCursor(),但光标仍然没有改变.为什么? 答:试一下处理WM_SETCURSOR消息: afx_msg void CMyWindow::OnSetCursor() { HCURSOR hCursor = NULL; switch ( cursor ) { case arrow: hCursor == AfxGetApp()->LoadCursor( IDC_MyArrow) break; ... } if ( hCursor != NULL ) { ::SetCursor( hCursor ) return; } CBaseWindowClass::OnSetCursor(); }