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

    Mouse Coordinates

    Hi,
    I'm drawing some graphics inside a CStatic, and I'm capturing a mouse click event in a class derived from CStatic. The message handler
    is called fine, unfortunately it doesn't pass me the coordinates of the click. Any idea how I can get that manually? Thanks.


  2. #2
    Join Date
    Apr 1999
    Posts
    48

    Re: Mouse Coordinates

    You could try using GetCurrentMessage to get the MSG structure which contains the info (if I remember correctly).

    Cheers,
    Roger


  3. #3
    Join Date
    May 1999
    Location
    Farnborough, Hants, England
    Posts
    710

    Re: Mouse Coordinates

    You could use:

    ---
    CPoint ptMouse ;
    POINT sPtMouse ;

    ::GetCursorPos(&sPtMouse);
    ptMouse = sPtMouse ;


    ---

    This, of course, relies on the message for the click being processed as quickly as a normal mouse message to a window, otherwise the mouse may have moved slightly since the message was generated.

    Does this help?


    --
    Jason Teagle
    [email protected]

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