在一个一直有的函数中设置,比如放在OnMouseMove中
解决方案 »
- 请教 如何用UpdateResource 更新资源?
- 对话框中Onpaint 函数两次调用自己写的画图函数,为什么第二次没有显示
- 关于工具栏显示的菜鸟问题
- 头痛啊,求教结构体中字节对齐的问题!
- 请问哪里有微软的计算器源代码下载!
- 向列表框中添加多个项时如何让他不闪烁
- 如何让窗体背景是一张图片,并在窗体上输出文字,此文字背景色是图片的
- 如何制作自己的字体(Windows环境)?而且做出来后可以用的。
- 请大家介绍几本网络编程的书,谢谢
- 在线紧急求助!!win2000下做的程序在win98里运行出错怎么解决????
- 高手看一看,我快快不行了,给你们:七根火柴.....
- 那有中文的API电子图书下载(.chm)
BOOL CSystemView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: この位置で CREATESTRUCT cs を修正して Window クラスまたはスタイルを
// 修正してください。
if(!CView::PreCreateWindow(cs))
return 0;
WNDCLASS wndcls;
HINSTANCE hinst=AfxGetInstanceHandle();
if(!(::GetClassInfo(hinst,custom_classname,&wndcls)))
{
if(::GetClassInfo(hinst,cs.lpszClass ,&wndcls))
{
wndcls.lpszClassName=custom_classname;
wndcls.style|=CS_OWNDC;
wndcls.hCursor=LoadCursorFromFile("f:\\iu.ani");//this is the key
wndcls.hCursor=NULL;
wndcls.hbrBackground=::CreateSolidBrush(RGB(220,220,0));
if(!AfxRegisterClass(&wndcls))
AfxThrowResourceException();
}
else
AfxThrowResourceException();
}
cs.lpszClass=custom_classname;
return 1;
// return CView::PreCreateWindow(cs);
}
to:sam1111 如果放在mousemove里,我觉得不如放在OnSetCursor()里。不过它们总是不停地执行,难道就不能设置一次,就一直保持直到我下一次改变它吗?
If your application must set the cursor while it is in a window, make sure the class cursor for the specified window's class is set to NULL. If the class cursor is not NULL, the system restores the class cursor each time the mouse is moved.
So you'd better register one WNDCLASS for permanence, or you must use SetCursor() frequently.