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. Check whether click is part of double-click

Check whether click is part of double-click

Scheduled Pinned Locked Moved C / C++ / MFC
question
7 Posts 3 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.
  • P Offline
    P Offline
    pie
    wrote on last edited by
    #1

    Hello! Is there some smart way of checking whether a click with the left mouse button is part of a double-click? Or will I have to use a timer, that is, when the left mouse button is clicked, I use the timer to wait and see if I receive an WM_LBUTTONDBLCLK within some interval.

    T 2 2 Replies Last reply
    0
    • P pie

      Hello! Is there some smart way of checking whether a click with the left mouse button is part of a double-click? Or will I have to use a timer, that is, when the left mouse button is clicked, I use the timer to wait and see if I receive an WM_LBUTTONDBLCLK within some interval.

      T Offline
      T Offline
      toxcct
      wrote on last edited by
      #2

      you don't have to count time ! WM_LBUTTONDBLCLK tells you if you made a double click (that means your two click are into a time intervalle like specified in your windows settings.


      TOXCCT >>> GEII power

      P 1 Reply Last reply
      0
      • T toxcct

        you don't have to count time ! WM_LBUTTONDBLCLK tells you if you made a double click (that means your two click are into a time intervalle like specified in your windows settings.


        TOXCCT >>> GEII power

        P Offline
        P Offline
        pie
        wrote on last edited by
        #3

        I'm Sorry that I didn't describe the problem accurately enough.. When we look at the incomming messages, a double click looks like this: WM_LBUTTONDOWN <<<< WM_LBUTTONUP WM_LBUTTONDBLCLK WM_LBUTTONUP I want to check if the message marked with the <'s is part of a double click. I guess I could do this myself with a timer, i.e wait and see if a WM_LBUTTONDBLCLK shows up within a given interval, but I was wondering if there already existed a function to do this. Cheers.

        T 1 Reply Last reply
        0
        • P pie

          I'm Sorry that I didn't describe the problem accurately enough.. When we look at the incomming messages, a double click looks like this: WM_LBUTTONDOWN <<<< WM_LBUTTONUP WM_LBUTTONDBLCLK WM_LBUTTONUP I want to check if the message marked with the <'s is part of a double click. I guess I could do this myself with a timer, i.e wait and see if a WM_LBUTTONDBLCLK shows up within a given interval, but I was wondering if there already existed a function to do this. Cheers.

          T Offline
          T Offline
          toxcct
          wrote on last edited by
          #4

          no, timer is not a correct solution because if you change your mouse settings, this will not correspond to the new "reality". What i don't understand, is why you look at all the incomming messages ??? Windows send much and more messages, and if you start catching all of these, you'll die before. just associate a function to the WM_LBUTTONDBCLK and that'll work. To persuade yourself, do what you did to know which messages were sent, but with the mouse over menu items !!! Just catch the messages you need ! Moreover, if WM_LBUTTONDBCLK is sent, it's because you really made a double-click... And finally, to answer your last question, if wou wanted to know if WM_LBUTTONDOWN was part of a double-click, set a flag when this signal happens, but we get back to our first problem... you have to set your timer with the value windows asociate to a double-click... could you give me the reason why you need this ? thanks


          TOXCCT >>> GEII power

          P 1 Reply Last reply
          0
          • T toxcct

            no, timer is not a correct solution because if you change your mouse settings, this will not correspond to the new "reality". What i don't understand, is why you look at all the incomming messages ??? Windows send much and more messages, and if you start catching all of these, you'll die before. just associate a function to the WM_LBUTTONDBCLK and that'll work. To persuade yourself, do what you did to know which messages were sent, but with the mouse over menu items !!! Just catch the messages you need ! Moreover, if WM_LBUTTONDBCLK is sent, it's because you really made a double-click... And finally, to answer your last question, if wou wanted to know if WM_LBUTTONDOWN was part of a double-click, set a flag when this signal happens, but we get back to our first problem... you have to set your timer with the value windows asociate to a double-click... could you give me the reason why you need this ? thanks


            TOXCCT >>> GEII power

            P Offline
            P Offline
            pie
            wrote on last edited by
            #5

            What I need this for is a tray icon! Try clicking once on the windows messenger tray-icon: A menu pops up! Try double clicking: The application shows! Messenger obviously knows when I double click and when I single click, and it isn't just handling DBLCLK, because then the menu would popup the first time you clicked. When you right click the icon, the menu appears right away. When you left click, then menu doesn't appear until a second later. So I was guessing that they wait and see if a WM_LBUTTONDBLCLK is coming. :~

            T 1 Reply Last reply
            0
            • P pie

              What I need this for is a tray icon! Try clicking once on the windows messenger tray-icon: A menu pops up! Try double clicking: The application shows! Messenger obviously knows when I double click and when I single click, and it isn't just handling DBLCLK, because then the menu would popup the first time you clicked. When you right click the icon, the menu appears right away. When you left click, then menu doesn't appear until a second later. So I was guessing that they wait and see if a WM_LBUTTONDBLCLK is coming. :~

              T Offline
              T Offline
              toxcct
              wrote on last edited by
              #6

              yes you're right... thanks for that very good example :-D have a nice day dear pie


              TOXCCT >>> GEII power

              1 Reply Last reply
              0
              • P pie

                Hello! Is there some smart way of checking whether a click with the left mouse button is part of a double-click? Or will I have to use a timer, that is, when the left mouse button is clicked, I use the timer to wait and see if I receive an WM_LBUTTONDBLCLK within some interval.

                2 Offline
                2 Offline
                224917
                wrote on last edited by
                #7

                you are right, will have to use timer :(


                greatest thing is to do wot others think you cant
                suhredayan@omniquad.com

                messenger :suhredayan@hotmail.com

                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