mfc 部分电脑上不显示自定义光标
furey 2012-07-29 04:27:51 用MFC编程,在设置光标的响应函数里设置了自定义光标,在自己电脑上运行没有问题(win7),但拿到别人电脑XP就显示不出来,是什么没都没的,都不知道自己的鼠标移动到哪里了。请问这个是为什么啊?
代码如下
</code>
BOOL CGraphic::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
// TODO: 在此添加消息处理程序代码和/或调用默认值
CPoint pt;
GetCursorPos(&pt);
ScreenToClient(&pt);
if(CSRect.PtInRect(pt))
{
if(m_eFunction == MOVE)
{
if(pt.x < CSRect.Width()/2)
{
hCursor = AfxGetApp()->LoadCursorW(IDC_BACKWARD);
SetCursor(hCursor);
}
if(pt.x > CSRect.Width()/2)
{
hCursor=AfxGetApp()->LoadCursorW(IDC_FORWARD);
SetCursor(hCursor);
}
return true;
}
if(m_eFunction == ZOOM)
{
if(bZoomOut)
hCursor = AfxGetApp()->LoadCursorW(IDC_CURSOR1);
else
hCursor = AfxGetApp()->LoadCursorW(IDC_CURSOR2);
SetCursor(hCursor);
return true;
}
}
return CDialog::OnSetCursor(pWnd, nHitTest, message);
}
</code>