Re: double click in CBitmapButton problem.
"timza1221" <timza1221-/[email protected]>
| Newsgroups | gmane.comp.windows.wtl |
|---|---|
| Message-ID | <[email protected]> |
> I think the problem is that you really should not be handling WM_LBUTTONDOWN/UP but instead BN_CLICKED/BN_DOUBLECLICKED. The reason is that the BN_ messages are synthesized by the window procedure, typically on mouse up. For example, try doing mouse-down on any button but moving the mouse off the button before mouse up: no click.
>
> The reason these need to be synthesized is because Windows waits to see if there is a second click within the configurable double-click time period before deciding that a click or a double-click has occurred.
>
> By handling the specific mouse down/up messages, you are interferring with the standard Windows behavior, worse if you are handling mouse down, and even worse if you are eating the messages and not passing them on to the default window procedure. It is getting confused and does not know the state of the mouse.
>
> My question about reflection had to do with whether you were handling the messages in the dialog (parent) or the button itself. If the window procedure in the dialog is getting confused, that could explain the strange behavior you noted.
>
> ~Mike
>
This is a great explanation Thanks!
I am creating my own buttondown, button up, etc. states based on other states, so I need to handle those messages. My functionality needs to be more than BN_CLICKED etc.
But knowing this maybe makes some sense until I can write more test cases.
Todd.
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/wtl/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/wtl/join
(Yahoo! ID required)
<*> To change settings via email:
mailto:[email protected]
mailto:[email protected]
<*> To unsubscribe from this group, send an email to:
[email protected]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/