MFC VC ++ 2010 windows应用程序。 [英] MFC VC++ 2010 windows application.

查看:86
本文介绍了MFC VC ++ 2010 windows应用程序。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 我是在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


问候,Guido


 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

Regards, Guido


这篇关于MFC VC ++ 2010 windows应用程序。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆