Archived

This topic is now archived and is closed to further replies.

Getting coordinates of a Static control

This topic is 5014 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am writing a dialog app, that has OpenGL inside a static control on my dialog, My problem is I want to have input functions like:
  • OnLButtonDown
  • OnMouseMove
  • OnLButtonUp
But the problem is that for Mouse move the CPoint structure, holds points referring to the whole screen, I need the CPoint structure to reference x,y coordinates for the static control. Can I do this, I''d appreciate any help Thanks in advance, Keith

Share this post


Link to post
Share on other sites
Use GetWindowRect to get the coordinates of the rendering window relative to the whole screen, and use this info to figure out the coordinates on the client.

If the control you''re rendering to has a border or anything like that, you might need to do a bit of additional work to take these into account.

Share this post


Link to post
Share on other sites