我用以下代码改变了鼠标图标:
HCURSOR hc,ohc;
hc=LoadCursorFromFile("d.cur");
ohc=SetCursor(hc);
ShowCursor(1);
Sleep(1000);
但只过了一秒就变回原来的鼠标了,
加了SetCapture()可以长期保持鼠标的图标不变回去,
但对话框上的按钮全按不动了,
怎么办?
HCURSOR hc,ohc;
hc=LoadCursorFromFile("d.cur");
ohc=SetCursor(hc);
ShowCursor(1);
Sleep(1000);
但只过了一秒就变回原来的鼠标了,
加了SetCapture()可以长期保持鼠标的图标不变回去,
但对话框上的按钮全按不动了,
怎么办?
CPoint curPt;
::GetCursorPos(&curPt);
ScreenToClient(&curPt); CRect cntRect(m_barClientRect);
cntRect.left = m_cxIEBar - 10;
cntRect.right = cntRect.left + 10; HCURSOR hCursor = NULL;
if(cntRect.PtInRect(curPt))
{
hCursor = AfxGetApp()->LoadStandardCursor(IDC_SIZEWE);
}
else
{
hCursor = AfxGetApp()->LoadStandardCursor(IDC_ARROW);
}
::SetCursor(hCursor);
HWND hwnd;
......
SetClassLong(hwnd , GCL_HCURSOR , (Long)hCursor)