How to judge if left button down in OnMouseMove while it is a SDI derived from CListView?
-
I'm using VC++2005. Make a project SDI which derived from CListView. Say it is CMyListView, then add OnMouseMove, OnLbuttondown, OnLbuttonup process to CMyListView. void CMyListView::OnMouseMove(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default if(nFlags & MK_LBUTTON) { AfxMessageBox(_T("enter")); } CListView::OnMouseMove(nFlags, point); } void CMyListView::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default SetCapture(); CListView::OnLButtonDown(nFlags, point); } void CMyListView::OnLButtonUp(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default ReleaseCapture(); CListView::OnLButtonUp(nFlags, point); } Then compile the project, drag and push mouse button in the view. No message box will pop up. But if it is a common CView, the message box will pop up. What's going on?
One day a pretty girl asked me:"Do u think you are handsome?" "I don't think so!".She gave a slap in my face:"Why lying?"...
-
I'm using VC++2005. Make a project SDI which derived from CListView. Say it is CMyListView, then add OnMouseMove, OnLbuttondown, OnLbuttonup process to CMyListView. void CMyListView::OnMouseMove(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default if(nFlags & MK_LBUTTON) { AfxMessageBox(_T("enter")); } CListView::OnMouseMove(nFlags, point); } void CMyListView::OnLButtonDown(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default SetCapture(); CListView::OnLButtonDown(nFlags, point); } void CMyListView::OnLButtonUp(UINT nFlags, CPoint point) { // TODO: Add your message handler code here and/or call default ReleaseCapture(); CListView::OnLButtonUp(nFlags, point); } Then compile the project, drag and push mouse button in the view. No message box will pop up. But if it is a common CView, the message box will pop up. What's going on?
One day a pretty girl asked me:"Do u think you are handsome?" "I don't think so!".She gave a slap in my face:"Why lying?"...