How to use WM_LBUTTONDBLCLK in visual C++ 6?

Posted on 2006-06-07
Last Modified: 2008-03-10
I need to add a code into doubleclick event but somehow it crash with the WM_LBUTTONDOWN event. Please give help me..
I have added CS_DBLCLKS into window style as well but no help..

Thanks in advance
Question by:iphone
    1 Comment
    LVL 18

    Accepted Solution


    When using WM_LBUTTONDBLCLCK, the event is not actually a double click, but the second click within the double-click time.

    So, doubleclick time must be defined before. Assuming your program isn't seting this,it will use the time defined at user level, that is, the Windows settings (default is 500 ms), outside your program.

    If you want to define at runtime, should call the SetDoubleClickTime function.

    I am surprised with no results, because you have used CS_DBLCLKS correctly in the window class style (MUST use it to enable receive doubleclick messages).

    Are you using ScreenToClient and ClientToScreen for converting back and forth between the different coordinates? In general, we use it in conjunction with GetCursorPos to get mouse cursor's position. May be the crashes are caused by wrong coordinates not directly related to your code objectives.

    Pay attention also on:
    The member function OnLButtonDblClk is called by the framework to allow your application to handle a Windows message. The parameters passed to your function reflect the parameters received by the framework when the message was received. If you call the base-class implementation of this function, that implementation will use the parameters originally passed with the message and not the parameters you supply to the function.


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Suggested Solutions

    Title # Comments Views Activity
    fizzArray3  challenge 1 47
    Fix45 challenge 15 65
    factorial example challenge 10 44
    nestparen challenge 4 34
    This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
    If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
    Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    759 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now