|
-
February 19th, 2004, 01:26 PM
#16
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...
-
February 19th, 2004, 02:07 PM
#17
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.
-
February 19th, 2004, 02:43 PM
#18
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...
-
February 19th, 2004, 03:58 PM
#19
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|