[comp.windows.misc] I want my BUTTON1UP

tvillan@hpccc.HP.COM (Tim Villanueva) (11/15/88)

>Here's the problem: it clears this variable when it gets a WM_BUTTON1UP
>message, WHICH IT ONLY GETS IT YOU LET GO OF THE BUTTON **IN ITS WINDOW**.
>If you push button 1, then move out onto the desktop or another window,
>*THEN* let go of button 1, the dragging program doesn't clear its dragging


You should use BUTTONUP and BUTTONDOWN as special case state transitions.
Set your "flags" not ONLY on these messages, but on MOUSEMOVE messages.
You will get a flag with the MOUSEMOVE message that tells you whether either
or both buttons are down.  Depending on the previous state of the button
in question, you can take appropriate action.

Thus, when the mouse is released ouside your window, and then drug back
into your window, you know on the FIRST mousemove that the button is up.

BUTTONUP and BUTTONDOWN simply take care of the special case of when the
user clicks without moving  (to draw a DOT in a paint program maybe).

      Tim V