Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: MFC
Now i need to process a button's mouseup and mousedown event alone.
I has tried to use preTranslateMessage ,but when running the dailog ,the forms had no response.I want to use class derived from CButton to process the event,but i don't know how to do it.
Does somebody konw it?Please help me,Thank you very much.
Posted 20-Aug-12 23:28pm
Tony@Tc312

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

If you want to process the click event on a button, then you should proceed on that by right click the button and adding an event handler (i.e. click). I can't remember it properly, but I think that if you double click the button the event handler is automatically created for you...
 
If you want to control the mouse buttons, then you can filter the messages WM_LBUTTONDOWN[^],WM_RBUTTONDOWN...
 
Hope this helps.
 
Good luck.
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 490
1 Prakriti Goyal 302
2 Yogesh Kumar Tyagi 224
3 Maciej Los 185
4 Sergey Alexandrovich Kryukov 167
0 OriginalGriff 6,652
1 Sergey Alexandrovich Kryukov 5,449
2 Maciej Los 3,474
3 Peter Leow 3,303
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 21 Aug 2012
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100