MFC VC ++ 2010 windows应用程序。 [英] MFC VC++ 2010 windows application.
问题描述
我是在MFC VC ++ 2010中开发应用程序的新手。我必须开发 我项目中的一项要求。
要求:
我必须开发滚动条的代码。必须移动鼠标滚轮滚动。对,知道我可以通过评分来移动滚动条。但它也应该 用鼠标滚轮。
请告诉我如何实施。我也是已实施 一些代码粘贴在下面,但它不起作用。
请给我你的建议和意见。
BEGIN_MESSAGE_MAP(CMainFrame,CFrameWndEx)
      ON_WM_LBUTTONUP()
ON_WM_MOUSEWHEEL()
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
void CMainFrame :: OnMouseMove(UINT nFlags,CPoint point)
{
// TODO:在此处添加您的消息处理程序代码和/或调用默认值
nFlags = WM_MOUSEMOVE;
CFrameWndEx :: OnMouseMove(nFlags,point);
}
void CMainFrame :: OnLButtonUp(UINT nFlags,CPoint point)
{
// TODO:在此处添加您的消息处理程序代码和/或调用默认值<
nFlags = WM_LBUTTONUP;
CFrameWndEx :: OnMouseMove(nFlags,point);
}
void CMainFrame :: OnLButtonDown(UINT nFlags,CPoint point)
{
// TODO:在此处添加您的消息处理程序代码和/或调用默认值<
nFlags = WM_LBUTTONDOWN;
CFrameWndEx :: OnMouseMove(nFlags,point);
}
您好,
查看此文档:
https://docs.microsoft.com/de-de/ windows / desktop / inputdev / using-mouse-input
i am very new to develop the application in MFC VC++ 2010. i have to develop one requirement in my project.
requirement:
i have to develop the code for scroll bar. that have to move with mouse wheel scrolling. right know i can able to move the scroll bar by grading. but it should also with mouse wheel.
kindly please let me know how to implement. also i have implemented some code pasted below but it's not working.
kindly please give me your suggestions and inputs.
BEGIN_MESSAGE_MAP(CMainFrame, CFrameWndEx)
ON_WM_LBUTTONUP()
ON_WM_MOUSEWHEEL()
ON_WM_LBUTTONDOWN()
END_MESSAGE_MAP()
void CMainFrame::OnMouseMove(UINT nFlags, CPoint point)
{
//TODO : Add your message handler code here and/or call default
nFlags = WM_MOUSEMOVE;
CFrameWndEx::OnMouseMove(nFlags, point);
}
void CMainFrame::OnLButtonUp(UINT nFlags, CPoint point)
{
//TODO : Add your message handler code here and/or call default
nFlags = WM_LBUTTONUP;
CFrameWndEx::OnMouseMove(nFlags, point);
}
void CMainFrame::OnLButtonDown(UINT nFlags, CPoint point)
{
//TODO : Add your message handler code here and/or call default
nFlags = WM_LBUTTONDOWN;
CFrameWndEx::OnMouseMove(nFlags, point);
}
Hello,
have a look at this documentation: https://docs.microsoft.com/de-de/windows/desktop/inputdev/using-mouse-input
这篇关于MFC VC ++ 2010 windows应用程序。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!