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 calculate the time between LBUTTONDOWN and LBUTTONUP?

How to calculate the time between LBUTTONDOWN and LBUTTONUP?

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorialquestion
4 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.
  • W Offline
    W Offline
    wb_program
    wrote on last edited by
    #1

    I can't find any function for calculate the time between LBUTTONDOWN and LBUTTONUP,help me ~ :cool:

    J N T 3 Replies Last reply
    0
    • W wb_program

      I can't find any function for calculate the time between LBUTTONDOWN and LBUTTONUP,help me ~ :cool:

      J Offline
      J Offline
      JBAK_CP
      wrote on last edited by
      #2

      Here is a generic example on how to get elapsed time: CTime startTime; CTime endTime; CTimeSpan elapsedTime; On LBUTTONDOWN: startTime = CTime::GetCurrentTime(); On LBUTTONUP: endTime = CTime::GetCurrentTime(); elapsedTime = endTime - startTime; int timeout = elapsedTime.GetSeconds();

      1 Reply Last reply
      0
      • W wb_program

        I can't find any function for calculate the time between LBUTTONDOWN and LBUTTONUP,help me ~ :cool:

        N Offline
        N Offline
        Nibu babu thomas
        wrote on last edited by
        #3

        wb_program wrote:

        I can't find any function for calculate the time between LBUTTONDOWN and LBUTTONUP,help me ~ Cool

        Also probably you can use GetCurrentMessage which contains a DWORD value which gives the time the message was posted. Note that you should only call this from event handlers. So call this from mouse up and mouse down.

        Nibu babu thomas Microsoft MVP for VC++ Code must be written to be read, not by the compiler, but by another human being. Programming Blog: http://nibuthomas.wordpress.com

        1 Reply Last reply
        0
        • W wb_program

          I can't find any function for calculate the time between LBUTTONDOWN and LBUTTONUP,help me ~ :cool:

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

          You can use 'GetDoubleClickTime' to retreive double click time for your mouse.

          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