Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. How to judge if left button down in OnMouseMove while it is a SDI derived from CListView?

How to judge if left button down in OnMouseMove while it is a SDI derived from CListView?

Scheduled Pinned Locked Moved C / C++ / MFC
c++tutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Syouki_kou
    wrote on last edited by
    #1

    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?"...

    B 1 Reply Last reply
    0
    • S Syouki_kou

      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?"...

      B Offline
      B Offline
      babu_mcet
      wrote on last edited by
      #2

      well am facing same problem :(

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups