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. WM_LBUTTONDBLCLK not being sent?

WM_LBUTTONDBLCLK not being sent?

Scheduled Pinned Locked Moved C / C++ / MFC
questiondiscussion
6 Posts 4 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
    softwaremonkey
    wrote on last edited by
    #1

    I have a CWnd derrived window class and I have added handlers for WM_LBUTTONDBLCLK, WM_LBUTTONDOWN and WM_LBUTTONUP. However, OnLButtonDblClk() does not appear to be called when I double-click the window but the OnLButtonDown and OnLButtonUp handlers work OK. I have tried adding CS_DBLCLKS when creating (although this should not be necessary) but it still doesn't work. Any thoughts as to why this should be or what I could try? Thanks Tony

    H J 2 Replies Last reply
    0
    • S softwaremonkey

      I have a CWnd derrived window class and I have added handlers for WM_LBUTTONDBLCLK, WM_LBUTTONDOWN and WM_LBUTTONUP. However, OnLButtonDblClk() does not appear to be called when I double-click the window but the OnLButtonDown and OnLButtonUp handlers work OK. I have tried adding CS_DBLCLKS when creating (although this should not be necessary) but it still doesn't work. Any thoughts as to why this should be or what I could try? Thanks Tony

      H Offline
      H Offline
      Hans Dietrich
      wrote on last edited by
      #2

      Do you have a message map entry for WM_LBUTTONDBLCLK?

      Best wishes, Hans


      [Hans Dietrich Software]

      1 Reply Last reply
      0
      • S softwaremonkey

        I have a CWnd derrived window class and I have added handlers for WM_LBUTTONDBLCLK, WM_LBUTTONDOWN and WM_LBUTTONUP. However, OnLButtonDblClk() does not appear to be called when I double-click the window but the OnLButtonDown and OnLButtonUp handlers work OK. I have tried adding CS_DBLCLKS when creating (although this should not be necessary) but it still doesn't work. Any thoughts as to why this should be or what I could try? Thanks Tony

        J Offline
        J Offline
        Joan M
        wrote on last edited by
        #3

        In order to know if the message is being sent, you could use the spy++ software that comes with Visual Studio. Apart from that, depending on the way you've created the handlers you could be eliminating the double click in the click handler... Imagine you are doing the capture in a PreTranslateMessage assigned function and that after the event for WM_LBUTTONDOWN you would be cancelling the rest of the message queue. Two attempts to help you. I guess that the first step is mandatory to help you to find the place where the error origines... HTH!

        [www.tamelectromecanica.com] Robots, CNC and PLC machines for grinding and polishing.

        https://www.robotecnik.com freelance robots, PLC and CNC programmer.

        S 1 Reply Last reply
        0
        • J Joan M

          In order to know if the message is being sent, you could use the spy++ software that comes with Visual Studio. Apart from that, depending on the way you've created the handlers you could be eliminating the double click in the click handler... Imagine you are doing the capture in a PreTranslateMessage assigned function and that after the event for WM_LBUTTONDOWN you would be cancelling the rest of the message queue. Two attempts to help you. I guess that the first step is mandatory to help you to find the place where the error origines... HTH!

          [www.tamelectromecanica.com] Robots, CNC and PLC machines for grinding and polishing.

          S Offline
          S Offline
          softwaremonkey
          wrote on last edited by
          #4

          Thanks for the reply. I checked the messages being set using Spy as you suggested and the WM_LBUTTONDBLCLK was not being sent to the window. Just for a giggle, I then added CS_DBLCLKS style to the style member of the WNDCLASS when I register the window class and it then worked. I must admint that I dont really understand why this should be, because I add the CS_DBLCLKS style when I call Create later on. :~ Thanks for your help! :)

          J S 2 Replies Last reply
          0
          • S softwaremonkey

            Thanks for the reply. I checked the messages being set using Spy as you suggested and the WM_LBUTTONDBLCLK was not being sent to the window. Just for a giggle, I then added CS_DBLCLKS style to the style member of the WNDCLASS when I register the window class and it then worked. I must admint that I dont really understand why this should be, because I add the CS_DBLCLKS style when I call Create later on. :~ Thanks for your help! :)

            J Offline
            J Offline
            Joan M
            wrote on last edited by
            #5

            Nice to know it helped. ;)

            [www.tamelectromecanica.com] Robots, CNC and PLC machines for grinding and polishing.

            https://www.robotecnik.com freelance robots, PLC and CNC programmer.

            1 Reply Last reply
            0
            • S softwaremonkey

              Thanks for the reply. I checked the messages being set using Spy as you suggested and the WM_LBUTTONDBLCLK was not being sent to the window. Just for a giggle, I then added CS_DBLCLKS style to the style member of the WNDCLASS when I register the window class and it then worked. I must admint that I dont really understand why this should be, because I add the CS_DBLCLKS style when I call Create later on. :~ Thanks for your help! :)

              S Offline
              S Offline
              SledgeHammer01
              wrote on last edited by
              #6

              As you discovered, CS_DBLCLKS is a *CLASS* style, it won't work in the Window Create.

              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