Click here to Skip to main content
11,640,445 members (63,282 online)
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@Tc315

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 Mika Wendelius 300
1 CPallini 209
2 OriginalGriff 165
3 Sergey Alexandrovich Kryukov 139
4 Afzaal Ahmad Zeeshan 130
0 Mika Wendelius 200
1 OriginalGriff 145
2 CPallini 115
3 jgakenhe 40
4 sasanka sekhar panda 30


Advertise | Privacy | Mobile
Web04 | 2.8.150731.1 | Last Updated 21 Aug 2012
Copyright © CodeProject, 1999-2015
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