在对话框上,移动图片控件上变成一只小手.
解决方案 »
- ie调用MFC创建的ocx控件时,点击刷新后,在操作进行控件操作,ie挂掉
- 关于vc用ShellExecute调用Winrar的问题
- 为什么DLL中线程中不能退出了?
- 求一条SQl语句,插入信息时,如果数据库中已经存在(通过判断几个字段),则不插入该数据,怎么写????????????????
- 如何限制socket的连接数量?
- 如何得到listview列表中某一列的最大值数?
- 如何来 禁用 服务,不是开始和停止,是启用方式
- 类型转化
- 添加#define _UNICODE后编译出错
- 散分!
- 如何动态切换工具栏?
- 请问,在客户端用recv接受数据,在没有数据的时候,为什么程序显示无响应,而且窗口就像死了似的。
::SetCursor(AfxGetApp()->LoadCursor(IDC_HANDLECURSOR));
IDC_HANDLECURSOR这个为你的手形光标资源
ptMouse.x = LOWORD(lParam); //取lParam低字节为横坐标x
ptMouse.y = HIWORD(lParam); //取lParam高字节为横坐标y
fwKeys = wParam;
//将鼠标按钮和键盘组合赋给32位无符号整数fwKeys //下面代码对鼠标进行位置范围测试。如果鼠标落在位图上,那
//么把鼠标指针设置为自定义的
//否则,采用普通的箭头鼠标。 if (PtInRect(&rect1, ptMouse) || PtInRect(&rect2, ptMouse)) //判断指定点是否在指定矩形内
SetCursor(hCursorPen);
BOOL CYourWnd::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message)
{
if ( your candition )
{
::SetCursor( m_hHintCur ); //m_hHintCur Your cusstom cursor
return TRUE;
}
::SetCursor( m_hNormalCur );
return TRUE;
return CParentWnd::OnSetCursor(pWnd, nHitTest, message);
}
{
CRect rect;
CPoint ptCursor;
CWnd *pStatic1=GetDlgItem(IDC_STATIC1); pStatic1->GetWindowRect(rect); //得到static矩形的坐标
GetCursorPos(&ptCursor); //得到mouse位置
if(rect.PtInRect(ptCursor))
{
CWinApp *pApp=AfxGetApp();
HICON hIconBang=pApp->LoadCursor(IDC_MY_CURSOR); SetCursor(hIconBang); //设定此指针
return TRUE;
}
else
//否则不设定
return CDialog::OnSetCursor (pWnd, nHitTest, message);
}
{
// TODO: Add your message handler code here and/or call default
switch(pWnd->GetDlgCtrlID())
{
case IDC_PICTURE1:
SetCursor(AfxGetApp()->LoadCursor(IDC_CURSOR1));
return TRUE;
}
return CDialog::OnSetCursor(pWnd, nHitTest, message);
}