SetCursor(LoadCursor(NULL, IDC_CROSS)); //将光标变成十字型
m_rePt = point;
m_currentPt = point;
HCURSOR hCur = GetCursor();
if (hCursor)
{
ICONINFO curInfo;
GetIconInfo(hCur, &curInfo);
CBitmap* pBmp = CBitmap::FromHandle(curInfo.hbmMask);
BITMAP bmp;
if (pBmp != NULL && pBmp->GetBitmap(&bm))
{
int nHeight = bmp.bmHeight;
int nWidth = bmp.bmWidth;
m_rePt.x -= bmp.bmWidth / 2;
m_rePt.y -= bmp.bmHeight / 4;
m_currentPt.x -= bmp.bmWidth / 2;
m_currentPt.y -= bmp.bmHeight / 4;
}
}
更改光标形状并获得其大小
最新推荐文章于 2017-11-01 15:58:00 发布