mouse event
-
How can I tell wether a button control is being held down or not? I can't seem to use the flag from WM_LBUTTONDOWN because I don't have the same flag parameter passed into my button handler Any ideas? Andy
-
hmm tried what you said, what I really want is this, and I couldn't get it to work. I want to execute one bit of code when the button is pressed and then another when it is released. How can I do that? Andy
Just a suggestion: you can perhaps subclass your own button class (derived from CButton) and add handlers for the WM_LBUTTONDOWN and the WM_LBUTTONUP messages. In these functions, send a notification message to the parent. Hope this helps
-
Just a suggestion: you can perhaps subclass your own button class (derived from CButton) and add handlers for the WM_LBUTTONDOWN and the WM_LBUTTONUP messages. In these functions, send a notification message to the parent. Hope this helps
-
is there any way to detect that a particular button is being held down. i.e. on the WM_LBUTTONDOWN message, how can I check wether a particular button is pressed in a similar way to say a checkbox? Andy ps what notification message do you mean?
Another suggsetion is to add handlers for the WM_LBUTTONDOWN and WM_LBUTTONUP messages in your dialog (or view) class. In these functions, test if the position (the point parameter) is on the button. For this you can use CWnd::ChildWindowFromPoint (take a look at the documentation) and then call GetDlgCtrlID for the CWnd that is returned to see if this is your button. You can also use flags to keep trace if the button is pressed or not. Hope this helps