Click to See Complete Forum and Search --> : Mouse Coordinates


April 17th, 1999, 05:05 PM
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.

Roger Osborn
April 17th, 1999, 05:14 PM
You could try using GetCurrentMessage to get the MSG structure which contains the info (if I remember correctly).

Cheers,
Roger

Jason Teagle
April 19th, 1999, 02:39 AM
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?