CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: NM_CLICK

  1. #1
    Join Date
    Apr 1999
    Location
    Scottsdale, Arizona
    Posts
    28

    NM_CLICK

    I have a common control where I want to process left mouse clicks. According to the VC++ 6.0 documentation, the control receives a WM_NOTIFY message with a pointer to an NMHDR structure with the code data member set to NM_CLICK. I have not been able to determine the location of the mouse click from this message, which, to me, seems to be the whole point of processing mouse clicks.

    Does anyone know how to get the location of the mouse click when some clicks the left mouse button for a common control?


    The message handler function is prototyped as:
    void Common_Control::OnLeftMouseClick(NMHDR* pNMHDR, LRESULT* pResult);



  2. #2
    Join Date
    Apr 1999
    Location
    California, USA
    Posts
    9

    Re: NM_CLICK

    // Get the current position of the cursor.
    CPoint point(::GetMessagePos());

    // Convert it to client coordinates.
    ScreenToClient(&point);



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