BOOL CViewView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.lpszClass = AfxRegisterWndClass(0,0,CreateSolidBrush(RGB(212,208,200)),0); //改变背景颜色
cs.cx = 500;//出错
cs.cy = 500;//出错 return CView::PreCreateWindow(cs);
}而且当我cs.lpszClass = AfxRegisterWndClass(0,0,CreateSolidBrush(RGB(212,208,200)),0); 改变背景颜色后打开程序鼠标会变“漏斗形状”大概有3~5秒的样子
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.lpszClass = AfxRegisterWndClass(0,0,CreateSolidBrush(RGB(212,208,200)),0); //改变背景颜色
cs.cx = 500;//出错
cs.cy = 500;//出错 return CView::PreCreateWindow(cs);
}而且当我cs.lpszClass = AfxRegisterWndClass(0,0,CreateSolidBrush(RGB(212,208,200)),0); 改变背景颜色后打开程序鼠标会变“漏斗形状”大概有3~5秒的样子
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.lpszClass = AfxRegisterWndClass(0,0,CreateSolidBrush(RGB(212,208,200)),0); //改变背景颜色 return CView::PreCreateWindow(cs);
} 为什么当启动程序时鼠标第一次在VIEW面板上时是"漏斗"形,当移出VIEW后再进入就正常了????
因为当你的鼠标在view里面的时候不能对鼠标进行处理 程序启动的时候是漏斗状 按理说到里面应该变成指针形状 但是他没有处理 则保持了漏斗形状。当你移动出来的时候 windows对桌面上的鼠标进行了处理 改为指针状 然后你再移动进去还是没有进行处理 还是指针状。 同样 你可以拿另外一个窗体 重叠在VIEW上面来看 比如拖动边框的时候变为其他指针 此时你将其移动到重叠的窗口外面 那个指针就一直会是那个形状了。解决方法 用SetCursor指定在view里为指针状
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
cs.cx = 500;
cs.cy = 500; return TRUE;
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
....
this->MoveWindow(100,100,700,400);}
现在就是设置SetCursor不知道在哪设置