CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2005
    Posts
    33

    Help me with WM_LBUTTONUP\DOWN

    Hi,

    The purpose is the following. I have a button IDC_MYBUTTON. I want to handle two separate events: the first when the user pushes the button and then the second - when he releases it. Please help me to do that.

    I tried to use WM_LBUTTONUP and WM_LBUTTONDOWN for the dialog which contains the button. But somehow it just doesn't execute the handlers when the user presses the button! It executes the handlers only when the user clicks on the dialog somewhere outside the button...

  2. #2
    Join Date
    Aug 1999
    Location
    <Classified>
    Posts
    6,882

    Re: Help me with WM_LBUTTONUP\DOWN

    You will have to subclass the button in order to trap mouse down and up events.
    Regards,
    Ramkrishna Pawar

  3. #3
    John E is offline Elite Member Power Poster
    Join Date
    Apr 2001
    Location
    Manchester, England
    Posts
    4,867

    Re: Help me with WM_LBUTTONUP\DOWN

    It sounds as though you're implementing the right handlers - but for the wrong object...! Make sure that you've implemented them for the button object and not some other object, such as the main window. Also, check that you haven't inadvertently mapped the notify message, instead of the message itself. The notify message would be WM_NCLBUTTONDOWN in this particular case.
    "A problem well stated is a problem half solved.” - Charles F. Kettering

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured