CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19
  1. #16
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656
    The cleanest (and most simple) way, in my opinion, is to handle windows messages in a standard way: OnLButtonDown() and OnLButtonDoubleClick() and call you specific functionality from there. For example, provide ProcessSingleClick() and ProcessDoubleClick() functions and call them from your OnLButtonDoubleClick() depending on external conditions.
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

  2. #17
    Join Date
    Dec 2001
    Location
    Bremen, Germany
    Posts
    314
    You're right, this would be the most simple and cleanest solution - it was my very first attempt to solve this problem.

    But unfortunately, the result is not as expected because in a series of button clicks in somewhat equal time intervals, not every click will probably be sent to the client. At least, it seems like that, but the reason for the perception of variing response time might also be that the system setting of the double-click time somehow interferes.
    I do not know, but it's easy to try and see, that this would not be a solution.

    But what's about the CS_DBLCLKS window style? Is there an easy or straightforward way to implement this solution it for some buttons of an already existing CButton derived class?

    Oliver.

  3. #18
    Join Date
    Aug 2000
    Location
    New York, NY, USA
    Posts
    5,656
    Well, your very first solution might work here. Remember, I noted "your solution will work ONLY if you want to change double-click handling for all windows of that class"? But what is a double click on a button, really? I would give it up anytime. Does it have a special meaning in your project?
    Looks like we did a full circle and came back to your original idea. I think that it is still very useful to analyze your other options, at least in order to prove your point.
    Vlad - MS MVP [2007 - 2012] - www.FeinSoftware.com
    Convenience and productivity tools for Microsoft Visual Studio:
    FeinWindows - replacement windows manager for Visual Studio, and more...

  4. #19
    Join Date
    Dec 2001
    Location
    Bremen, Germany
    Posts
    314
    Yes, I think this was a valuable discussion and I learned a lot (I think )...

    Sometimes, things in the Windows world are just not ideal (this one I knew before). What bothers me most is that I would not have that problem if my button were not ownerdrawn, because non-ownerdrawn buttons do not send double-click messages at all (at least not on my Win98 system).

    Thanks for all your input!

    Oliver.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured